diff options
| author | Mikhail Klimenko <m.klimenko@module.ru> | 2017-02-22 14:51:05 +0300 |
|---|---|---|
| committer | Mikhail Klimenko <m.klimenko@module.ru> | 2017-02-22 14:51:05 +0300 |
| commit | 42ac9bbe1e6440dd9e84b6fdd28a4f61792a73f3 (patch) | |
| tree | 1fed55f4af9975f8d744b139296573818c05790e /scripts | |
| parent | fa3f9dd9628ebafd3ba65fb3abde6c1d6f0448fc (diff) | |
| download | vcpkg-42ac9bbe1e6440dd9e84b6fdd28a4f61792a73f3.tar.gz vcpkg-42ac9bbe1e6440dd9e84b6fdd28a4f61792a73f3.zip | |
Add proxy credential support
Diffstat (limited to 'scripts')
| -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 6a40c9758..7c5c2a989 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] { |
