1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
This commit is contained in:
Artem Zinenko 2017-03-29 21:29:27 +03:00 committed by Matt Davis
parent 097173c6f5
commit a5da638d34

View file

@ -81,6 +81,14 @@ Else {
Try { Try {
$webRequest = [System.Net.HttpWebRequest]::Create($url) $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){ if($username -and $password){
$webRequest.Credentials = New-Object System.Net.NetworkCredential($username, $password) $webRequest.Credentials = New-Object System.Net.NetworkCredential($username, $password)