Closed potatoqualitee closed 2 years ago
hmmm i already do this
if ((Get-Command Start-BitsTransfer -ErrorAction Ignore)) { try { $null = Start-BitsTransfer -Source $link -Destination $file -ErrorAction Stop } catch { Write-Progress -Activity "Downloading $FilePath" -Id 1 $null = Invoke-TlsWebRequest -OutFile $file -Uri "$link" Write-Progress -Activity "Downloading $FilePath" -Id 1 -Completed } } else { try { # IWR is crazy slow for large downloads Write-Progress -Activity "Downloading $FilePath" -Id 1 $null = Invoke-TlsWebRequest -OutFile $file -Uri "$link" Write-Progress -Activity "Downloading $FilePath" -Id 1 -Completed } catch { Stop-PSFFunction -EnableException:$EnableException -Message "Failure" -ErrorRecord $_ -Continue } }
hmmm i already do this