Commit 154dbc59 authored by Niklas Schulze's avatar Niklas Schulze Committed by Michael Goderbauer

update_dart_sdk.ps1: Fall back to Invoke-WebRequest if BITS fails (#19873)

parent 1b81b612
...@@ -43,8 +43,15 @@ if (Test-Path $dartSdkPath) { ...@@ -43,8 +43,15 @@ if (Test-Path $dartSdkPath) {
} }
New-Item $dartSdkPath -force -type directory | Out-Null New-Item $dartSdkPath -force -type directory | Out-Null
$dartSdkZip = "$cachePath\$dartZipName" $dartSdkZip = "$cachePath\$dartZipName"
Import-Module BitsTransfer
Start-BitsTransfer -Source $dartSdkUrl -Destination $dartSdkZip Try {
Import-Module BitsTransfer
Start-BitsTransfer -Source $dartSdkUrl -Destination $dartSdkZip
}
Catch {
Write-Host "Downloading the Dart SDK using the BITS service failed, retrying with WebRequest..."
Invoke-WebRequest -Uri $dartSdkUrl -OutFile $dartSdkZip
}
Write-Host "Unzipping Dart SDK..." Write-Host "Unzipping Dart SDK..."
If (Get-Command 7z -errorAction SilentlyContinue) { If (Get-Command 7z -errorAction SilentlyContinue) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment