Fix type error in Get-File in win32.ps1

This commit is contained in:
Shivam Mathur 2024-03-25 02:42:14 +05:30
parent 31bfabaf56
commit db8db3c7c7
No known key found for this signature in database
GPG Key ID: 3E13E4C8591ACC2A

View File

@ -133,14 +133,14 @@ Function Get-File {
param (
[string]$Url,
[string]$FallbackUrl,
[string]$OutFile,
[string]$OutFile = '',
[int]$Retries = 3,
[int]$TimeoutSec = 0
)
for ($i = 0; $i -lt $Retries; $i++) {
try {
if($null -ne $OutFile) {
if($OutFile -ne '') {
Invoke-WebRequest -Uri $Url -OutFile $OutFile -TimeoutSec $TimeoutSec
} else {
Invoke-WebRequest -Uri $Url -TimeoutSec $TimeoutSec
@ -150,7 +150,7 @@ Function Get-File {
if ($i -eq ($Retries - 1)) {
if($FallbackUrl) {
try {
if($null -ne $OutFile) {
if($OutFile -ne '') {
Invoke-WebRequest -Uri $FallbackUrl -OutFile $OutFile -TimeoutSec $TimeoutSec
} else {
Invoke-WebRequest -Uri $FallbackUrl -TimeoutSec $TimeoutSec