Skip to content

Commit

Permalink
Fix type error in Get-File in win32.ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
shivammathur committed Mar 24, 2024
1 parent 31bfaba commit db8db3c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/scripts/win32.ps1
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit db8db3c

Please sign in to comment.