File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,7 +20,6 @@ $ProgressPreference = 'SilentlyContinue'
2020[int ]$maxRetries = 3
2121[int ]$retryCount = 0
2222[int ]$StatusCode = 200
23- $response = $null
2423
2524
2625$version_und = $version.Replace (' .' , ' _' )
@@ -34,29 +33,25 @@ if (-not (Test-Path $outputfile)) {
3433 Write-Host " Boost not cached, downloading it: from $uri to $outputfile "
3534 do {
3635 try {
37- $response = Invoke-WebRequest - Uri " $uri " - OutFile " $outputfile "
36+ Invoke-WebRequest - Uri " $uri " - Verbose - OutFile " $outputfile "
3837 break
3938 } catch {
4039 $StatusCode = $_.Exception.Response.StatusCode
4140 $errorMessage = $_.Exception.Message
42- $response = $null
4341 $retryCount ++
4442 Write-Host " Attempt $retryCount failed: $StatusCode $errorMessage . Retrying $uri ..."
4543 Start-Sleep - Seconds 2 # Wait before retrying
4644 }
4745 } until ($retryCount -ge $maxRetries )
4846
49- if ($response -eq $null ) {
47+ if ($retryCount -ge $maxRetries ) {
5048 Write-Host " Request failed after $retryCount attempts."
5149 exit 1
5250 } else {
5351 Write-Host " Boost downloaded"
52+ dir $output_file
5453 }
55- } else { Write-Host " Boost already installed" }
56-
57- if (Test-Path ' ./boost.exe' ) {
58- echo " Boost executable found."
59- dir
60- } else {
61- echo " Error: Boost executable not found."
54+ } else {
55+ Write-Host " Boost already downloaded"
56+ dir $output_file
6257}
You can’t perform that action at this time.
0 commit comments