Hi,
I have external repository from where I need to download my installation files. They are in zip or msi format - for both I noticed that SOMETIMES (about 50%) it does not download them properly.
Invoke-WebRequest -Headers @{‘X-JFrog-Art-Api’=$API_KEY} “$COMPONENT/PowerShell_7_0_0.zip” -OutFile “$DOWNLOAD_PATH\PowerShell_7_0_0.zip”
Because of that my file is not useful, it’s invalid.
I know I can check it “checksum” and compare it with expected value:
(Get-FileHash -Algorithm SHA256 C:\Octopus\Applications<span style=“font-size: 10pt;font-family: ‘courier new’, courier, monospace”>PowerShell_7_0_0.zip).Hash
But isn’t there some better way how I can overcome this? Maybe some built-in TimeOut or Retry for Invoke-WebRequest… or maybe to use some other method… I do not know…
But this is really a big issue which I suppose someone already encountered and resolved it…
I will appreciate very much your assistance. Thanks