Skip to content

Commit 7df8ef8

Browse files
authored
Fix incorrect mettered connection detected in Windows Server 2022
1 parent 2e4f1a2 commit 7df8ef8

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
@@ -46,7 +46,7 @@ function Test-Network {
4646
return $true
4747
}
4848

49-
if ($cost.ApproachingDataLimit -or $cost.OverDataLimit -or $cost.Roaming -or $cost.BackgroundDataUsageRestricted -or ($networkCostTypeName -ne "Unrestricted")) {
49+
if ($cost.ApproachingDataLimit -or $cost.OverDataLimit -or $cost.Roaming -or $cost.BackgroundDataUsageRestricted -or ($networkCostTypeName -ne "Unrestricted" -and $networkCostTypeName -ne "Unknown")) {
5050
Write-ToLog "Metered connection detected." "Yellow"
5151

5252
if ($WAUConfig.WAU_DoNotRunOnMetered -eq 1) {
@@ -87,4 +87,4 @@ function Test-Network {
8787
Start-NotifTask -Title $Title -Message $Message -MessageType $MessageType -Balise $Balise
8888

8989
return $false
90-
}
90+
}

0 commit comments

Comments
 (0)