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
# Should be run under SYSTEM user | |
$Devs = Get-PnpDevice -class net | ? Status -eq Error | Select FriendlyName,InstanceId | |
ForEach ($Dev in $Devs) { | |
Write-Host "Incorrect device $($Dev.FriendlyName) $($Dev.InstanceId)" -ForegroundColor Yellow | |
$RemoveKey = "HKLM:\SYSTEM\CurrentControlSet\Enum\$($Dev.InstanceId)" | |
Write-Host "Removing ${RemoveKey}..." -ForegroundColor White | |
Get-Item $RemoveKey | Select-Object -ExpandProperty Property | %{ Remove-ItemProperty -Path $RemoveKey -Name $_ -Verbose } | |
} |
OlderNewer