mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-22 11:51:07 +07:00
Fix type error in Get-File in win32.ps1
This commit is contained in:
parent
31bfabaf56
commit
db8db3c7c7
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user