diff options
| author | Robert Schumacher <roschuma@microsoft.com> | 2017-02-28 06:09:03 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-02-28 06:09:03 -0800 |
| commit | 61254273ba9f4c88319326924a0f536a1f72a749 (patch) | |
| tree | 1c0d6c60e63129fe1a755f4de2d5e1cbc9723679 /scripts/fetchDependency.ps1 | |
| parent | ccf4d5b3c20cbd2622f732e11123db2898d29014 (diff) | |
| parent | 42ac9bbe1e6440dd9e84b6fdd28a4f61792a73f3 (diff) | |
| download | vcpkg-61254273ba9f4c88319326924a0f536a1f72a749.tar.gz vcpkg-61254273ba9f4c88319326924a0f536a1f72a749.zip | |
Merge pull request #701 from MKlimenko/master
Add proxy credential support
Diffstat (limited to 'scripts/fetchDependency.ps1')
| -rw-r--r-- | scripts/fetchDependency.ps1 | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index 4f1799d0b..712993ca5 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -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] { |
