Skip to content

Commit 6702e91

Browse files
authored
Merge pull request #1059 from panreyes/main
Fix incorrect mettered connection detected in Windows Server 2022
2 parents 1ab1976 + a0a2986 commit 6702e91

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Sources/Winget-AutoUpdate/functions/Test-Network.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ function Test-Network {
4747
return $true
4848
}
4949

50-
$isMetered = $cost.ApproachingDataLimit -or $cost.OverDataLimit -or $cost.Roaming -or $cost.BackgroundDataUsageRestricted -or $networkCostTypeName -ne "Unrestricted"
50+
$isMetered = $cost.ApproachingDataLimit -or $cost.OverDataLimit -or $cost.Roaming -or $cost.BackgroundDataUsageRestricted -or ($networkCostTypeName -ne "Unrestricted" -and $networkCostTypeName -ne "Unknown")
5151

5252
if ($isMetered) {
5353
Write-ToLog "Metered connection detected." "Yellow"
@@ -75,4 +75,4 @@ function Test-Network {
7575
Start-NotifTask -Title $NotifLocale.local.outputs.output[1].title `
7676
-Message $NotifLocale.local.outputs.output[1].message -MessageType "error" -Balise "Connection"
7777
return $false
78-
}
78+
}

0 commit comments

Comments
 (0)