Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
ar7z1 authored and nitzmahone committed Mar 29, 2017
1 parent 097173c commit a5da638
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/ansible/modules/windows/win_get_url.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,14 @@ Else {

Try {
$webRequest = [System.Net.HttpWebRequest]::Create($url)
if ($proxy_url) {
$proxy_server = New-Object System.Net.WebProxy($proxy_url, $true)
if ($proxy_username -and $proxy_password) {
$proxy_credential = New-Object System.Net.NetworkCredential($proxy_username, $proxy_password)
$proxy_server.Credentials = $proxy_credential
}
$webRequest.Proxy = $proxy_server
}

if($username -and $password){
$webRequest.Credentials = New-Object System.Net.NetworkCredential($username, $password)
Expand Down

0 comments on commit a5da638

Please sign in to comment.