Merge pull request #701 from MKlimenko/master

Add proxy credential support
This commit is contained in:
Robert Schumacher 2017-02-28 06:09:03 -08:00 committed by GitHub
commit 61254273ba

View File

@ -81,6 +81,14 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency)
if ($Dependency -ne "git") # git fails with BITS
{
try {
$WC = New-Object System.Net.WebClient
$ProxyAuth = !$WC.Proxy.IsBypassed($url)
If($ProxyAuth){
$ProxyCred = Get-Credential -Message "Enter credentials for Proxy Authentication"
$PSDefaultParameterValues.Add("Start-BitsTransfer:ProxyAuthentication","Basic")
$PSDefaultParameterValues.Add("Start-BitsTransfer:ProxyCredential",$ProxyCred)
}
Start-BitsTransfer -Source $url -Destination $downloadPath -ErrorAction Stop
}
catch [System.Exception] {