Created
September 22, 2020 14:30
-
-
Save comzyh/5dd32ef1d57b7f9a5d10ba9bb1cbafb5 to your computer and use it in GitHub Desktop.
Powershell Remove unused Hyper-V vEthernet Adapter
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
$Devs = (Get-NetAdapter | Where-Object -Property Name -Like vEthernet* | Where-Object -Property Status -Like "Not Present" ) | |
ForEach ($Dev in $Devs) { | |
$RemoveKey = "HKLM:\SYSTEM\Setup\Upgrade\NetworkDriverBackup\Control\Network\{4d36e972-e325-11ce-bfc1-08002be10318}\$($Dev.InstanceId)" | |
Remove-Item -Path $RemoveKey | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment