Created
March 4, 2016 11:35
-
-
Save itpropro/803bdbd93711bcda44ee 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
$nics = Get-CimInstance Win32_NetworkAdapter -Filter 'netenabled = true' | |
$powerenabled = Get-CimInstance -Namespace root\wmi -ClassName MSPower_DeviceWakeEnable | |
$nics|% {if ($powerenabled.InstanceName -match [regex]::Escape($_.PNPDeviceID)) {$powernics = $_.PNPDeviceID}} | |
$Items = $powerenabled|Where-Object {$_.InstanceName -like "$powernics*"} | |
$Items.Enable = $true | |
Set-CimInstance -InputObject $Items |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment