Created
November 30, 2021 13:18
-
-
Save vpetrigo/5292b760806f5387a2541c42dbc02435 to your computer and use it in GitHub Desktop.
Remove stale USB COM and LPT ports in Windows
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
Get-PnpDevice -Class "Ports" | select -property "Status","InstanceId" | where -property "status" -value "Unknown" -EQ | foreach { pnputil /remove-device $_.InstanceId } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment