mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
parent
097173c6f5
commit
a5da638d34
1 changed files with 8 additions and 0 deletions
|
@ -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)
|
||||||
|
|
Loading…
Reference in a new issue