Skip to content

Instantly share code, notes, and snippets.

@comzyh
Created September 22, 2020 14:30
Show Gist options
  • Save comzyh/5dd32ef1d57b7f9a5d10ba9bb1cbafb5 to your computer and use it in GitHub Desktop.
Save comzyh/5dd32ef1d57b7f9a5d10ba9bb1cbafb5 to your computer and use it in GitHub Desktop.
Powershell Remove unused Hyper-V vEthernet Adapter
$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