Created
October 26, 2021 17:31
-
-
Save spacemeowx2/76cdd6f4093340f78bef919ea326d87a to your computer and use it in GitHub Desktop.
Clear all UPnP devices
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
$upnppath = 'HKLM:\System\CurrentControlSet\Enum\SWD\DAFUPnPProvider' | |
$upnpdevices = Get-ChildItem $upnppath | Get-ItemProperty -name 'FriendlyName' | |
foreach ($upnpdevice in $upnpdevices) { | |
if ($upnpdevice.'FriendlyName' -ne 'I wont be deleted') { | |
$name = $upnpdevice.PSChildName | |
echo "Deleting $name" | |
pnputil /remove-device "SWD\DAFUPnPProvider\$name" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment