20200630--Powershell禁用网卡节能模式
1 $searchText ="LsoV2IPv4" 2 $Regpath = "HKLM:\SYSTEM\CurrentControlSet\Control\Class" 3 4 Get-ChildItem $Regpath -Recurse -ErrorAction SilentlyContinue | 5 ForEach-Object { 6 if((get-itemproperty -Path $_.PsPath) -match $searchText) 7 { 8 $_.PsPath 9 ForEach-Object { 10 Set-ItemProperty -Path $_.PsPath -Name PnPCapabilities -Value "24" -ErrorAction Continue 11 } 12 } 13 } 14 Get-NetAdapter -Name '以太网' | Restart-NetAdapter
浙公网安备 33010602011771号