Skip to content

Commit

Permalink
[powershell] Remove usages of BitsTransfer
Browse files Browse the repository at this point in the history
  • Loading branch information
alexkaratarakis committed Jan 18, 2018
1 parent 8e773df commit 3390007
Showing 1 changed file with 0 additions and 27 deletions.
27 changes: 0 additions & 27 deletions scripts/VcpkgPowershellUtils.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,6 @@ function vcpkgCheckEqualFileHash( [Parameter(Mandatory=$true)][string]$filePat
}
}

if (vcpkgHasModule -moduleName 'BitsTransfer')
{
Import-Module BitsTransfer -Verbose:$false
}

function vcpkgDownloadFile( [Parameter(Mandatory=$true)][string]$url,
[Parameter(Mandatory=$true)][string]$downloadPath)
{
Expand All @@ -119,28 +114,6 @@ function vcpkgDownloadFile( [Parameter(Mandatory=$true)][string]$url,
$wc.Proxy.Credentials = vcpkgGetCredentials
}

# Some download (e.g. git from github)fail with Start-BitsTransfer
if (vcpkgHasCommand -commandName 'Start-BitsTransfer')
{
try
{
if ($proxyAuth)
{
$PSDefaultParameterValues.Add("Start-BitsTransfer:ProxyAuthentication","Basic")
$PSDefaultParameterValues.Add("Start-BitsTransfer:ProxyCredential", $wc.Proxy.Credentials)
}
Start-BitsTransfer -Source $url -Destination $downloadPartPath -ErrorAction Stop
Move-Item -Path $downloadPartPath -Destination $downloadPath
return
}
catch [System.Exception]
{
# If BITS fails for any reason, delete any potentially partially downloaded files and continue
vcpkgRemoveItem $downloadPartPath
}
}

Write-Verbose("Downloading $Dependency...")
$wc.DownloadFile($url, $downloadPartPath)
Move-Item -Path $downloadPartPath -Destination $downloadPath
}
Expand Down

0 comments on commit 3390007

Please sign in to comment.