Skip to content

Commit

Permalink
Fix Get-File in win32.ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
shivammathur committed Apr 2, 2023
1 parent 1f8252a commit c61bd0e
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/scripts/win32.ps1
Expand Up @@ -147,15 +147,19 @@ Function Get-File {
}
break;
} catch {
if ($i -eq ($Retries - 1) -and ($null -ne $FallbackUrl)) {
try {
if($null -ne $OutFile) {
Invoke-WebRequest -Uri $FallbackUrl -OutFile $OutFile -TimeoutSec $TimeoutSec
} else {
Invoke-WebRequest -Uri $FallbackUrl -TimeoutSec $TimeoutSec
if ($i -eq ($Retries - 1)) {
if($FallbackUrl) {
try {
if($null -ne $OutFile) {
Invoke-WebRequest -Uri $FallbackUrl -OutFile $OutFile -TimeoutSec $TimeoutSec
} else {
Invoke-WebRequest -Uri $FallbackUrl -TimeoutSec $TimeoutSec
}
} catch {
throw "Failed to download the assets from $Url and $FallbackUrl"
}
} catch {
throw "Failed to download the assets from $Url and $FallbackUrl"
} else {
throw "Failed to download the assets from $Url"
}
}
}
Expand Down

0 comments on commit c61bd0e

Please sign in to comment.