Skip to content

Commit

Permalink
Fix connection error in PS<6 when IE is unavailable
Browse files Browse the repository at this point in the history
  • Loading branch information
reisir committed May 9, 2023
1 parent cb73405 commit 1d52060
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions MetersOnDemand.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -235,10 +235,11 @@ function Get-Request {
$Uri
)
try {
$response = Invoke-WebRequest -Uri $Uri
$response = Invoke-WebRequest -Uri $Uri -UseBasicParsing
return $response
}
catch {
Write-Host $_
return $false
}
}
Expand Down Expand Up @@ -293,7 +294,7 @@ function Update-Cache {
}

$response = Get-Request $skinsAPI
if (-not $response) {
if (!$response) {
Write-Host "Couldn't reach API, using cache..." -ForegroundColor Yellow
if (!$SkipInstalled) { $Cache = Get-InstalledSkins -Cache $Cache }
return $Cache
Expand Down

0 comments on commit 1d52060

Please sign in to comment.