Merge pull request #909 from daxgames/http_proxy

Added proxy support
This commit is contained in:
Benjamin Staneck 2016-04-05 16:48:05 +02:00
commit 528d0ce734

View File

@ -99,6 +99,9 @@ function Download-File {
$File = $File -Replace "/", "\"
Write-Verbose "Downloading from $Url to $File"
$wc = new-object System.Net.WebClient
$wc.Proxy.Credentials=[System.Net.CredentialCache]::DefaultNetworkCredentials;
if ($env:https_proxy) {
$wc.proxy = (new-object System.Net.WebProxy($env:https_proxy))
}
$wc.Proxy.Credentials=[System.Net.CredentialCache]::DefaultNetworkCredentials;
$wc.DownloadFile($Url, $File)
}