File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 7474 $OutFile
7575 )
7676
77- $maxRetries = 3
77+ $maxRetries = 5
7878 $retryCount = 0
79+ $delay = 2
7980 $success = $false
8081
8182 while (-not $success -and $retryCount -lt $maxRetries) {
8485 $success = $true
8586 } catch [System.Net.WebException] {
8687 Write-Output "Attempt $($retryCount + 1) failed. Retrying..."
87- Start-Sleep -Seconds 3
88+ Start-Sleep -Seconds $delay
8889 $retryCount++
90+ $delay += $delay
8991 }
9092 }
9193
9496 }
9597 }
9698
97- Invoke-WebRequest-With-Retry "https://cygwin.com/$setupFileName" $setupExe
99+ Invoke-WebRequest-With-Retry "https://cygwin.com/bad/ $setupFileName" $setupExe
98100
99101 if ((Get-Item -LiteralPath $setupExe).Length -eq 0) {
100102 throw "The downloaded setup has a zero length!"
You can’t perform that action at this time.
0 commit comments