|
|
@ -44,9 +44,9 @@ $skip_certificate_validation = Get-Attr $params "skip_certificate_validation" $f
|
|
|
|
$username = Get-Attr $params "username"
|
|
|
|
$username = Get-Attr $params "username"
|
|
|
|
$password = Get-Attr $params "password"
|
|
|
|
$password = Get-Attr $params "password"
|
|
|
|
|
|
|
|
|
|
|
|
$proxy_url = $params.proxy_url
|
|
|
|
$proxy_url = Get-Attr $params "proxy_url"
|
|
|
|
$proxy_username = $params.proxy_username
|
|
|
|
$proxy_username = Get-Attr $params "proxy_username"
|
|
|
|
$proxy_password = $params.proxy_password
|
|
|
|
$proxy_password = Get-Attr $params "proxy_password"
|
|
|
|
|
|
|
|
|
|
|
|
if($skip_certificate_validation){
|
|
|
|
if($skip_certificate_validation){
|
|
|
|
[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true}
|
|
|
|
[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true}
|
|
|
@ -56,8 +56,8 @@ $force = Get-Attr -obj $params -name "force" "yes" | ConvertTo-Bool
|
|
|
|
|
|
|
|
|
|
|
|
If ($force -or -not (Test-Path $dest)) {
|
|
|
|
If ($force -or -not (Test-Path $dest)) {
|
|
|
|
$client = New-Object System.Net.WebClient
|
|
|
|
$client = New-Object System.Net.WebClient
|
|
|
|
if($params.proxy_url) {
|
|
|
|
if($proxy_url) {
|
|
|
|
$proxy_url = $params.proxy_url
|
|
|
|
$proxy_server = New-Object System.Net.WebProxy($proxy_url, $true)
|
|
|
|
if($proxy_username -and $proxy_password){
|
|
|
|
if($proxy_username -and $proxy_password){
|
|
|
|
$proxy_credential = New-Object System.Net.NetworkCredential($proxy_username, $proxy_password)
|
|
|
|
$proxy_credential = New-Object System.Net.NetworkCredential($proxy_username, $proxy_password)
|
|
|
|
$proxy_server.Credentials = $proxy_credential
|
|
|
|
$proxy_server.Credentials = $proxy_credential
|
|
|
|