mirror of
https://github.com/microsoft/vcpkg.git
synced 2025-01-18 13:13:34 +08:00
Add proxy credential support
This commit is contained in:
parent
fa3f9dd962
commit
42ac9bbe1e
@ -81,6 +81,14 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency)
|
|||||||
if ($Dependency -ne "git") # git fails with BITS
|
if ($Dependency -ne "git") # git fails with BITS
|
||||||
{
|
{
|
||||||
try {
|
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
|
Start-BitsTransfer -Source $url -Destination $downloadPath -ErrorAction Stop
|
||||||
}
|
}
|
||||||
catch [System.Exception] {
|
catch [System.Exception] {
|
||||||
|
Loading…
Reference in New Issue
Block a user