-
-
Save Anid4u2c/e9f5a831f7f878ba9dab81e7ab32c010 to your computer and use it in GitHub Desktop.
Powershell check if on metered network
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[void][Windows.Networking.Connectivity.NetworkInformation, Windows, ContentType = WindowsRuntime] | |
$cost = [Windows.Networking.Connectivity.NetworkInformation]::GetInternetConnectionProfile().GetConnectionCost() | |
$cost.ApproachingDataLimit -or $cost.OverDataLimit -or $cost.Roaming -or $cost.BackgroundDataUsageRestricted -or ($cost.NetworkCostType -ne "Unrestricted") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment