Last active
July 14, 2020 14:36
-
-
Save littletoyrobots/da3b4734f9c4791e7c1f4fabcccbabfd to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| Write-Verbose "Disable power saving on hardware network interfaces" | |
| foreach ($NIC in (Get-NetAdapter -Physical)) { | |
| $PowerSaving = Get-CimInstance -ClassName MSPower_DeviceEnable -Namespace root\wmi | Where-Object { $_.InstanceName -match [Regex]::Escape($NIC.PnPDeviceID) } | |
| if ($PowerSaving.Enable) { | |
| $PowerSaving.Enable = $false | |
| $PowerSaving | Set-CimInstance *>&1 | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment