GuideOS (Operating Systems)Microsoft Windows 11 Device Manager - Remove Hidden (Old) Items Updated May 21 2025
This Powershell script will get a list of all hidden devices from Device Manager and remove them. Use this after moving or cloning a drive to a new physically different Computer/Motherboard.

Copy to Clipboard $unknown_devices = Get-PnpDevice | Where-Object{$_.Status -eq 'Unknown'} $SkipList = @() $SkipList += 'DiskDrive' $SkipList += 'Printer' $SkipList += 'USB' $SkipList += 'SoftwareDevice' $SkipList += 'Ports' $SkipList += 'WPD' $SkipList += 'Image' $SkipList += 'PrintQueue' $SkipList += 'WSDPrintDevice' ForEach( $dev in $unknown_devices ){ if ( $SkipList -notcontains $dev.Class ){ $dev # This will show the details of this item pnputil /remove-device $dev.InstanceId # this will remove the specified devices. Comment this line to not remove it }else{ #write-host "Skipping $($dev.FriendlyName)" } }



A more advanced (and untested by me) script is available here:
https://github.com/istvans/scripts/blob/master/removeGhosts.ps1
Search Keywords: After Clone, Move, Migration, Upgrade, Remove, Drivers, Cleanup, Inactive, Old




©2024 - Some portions of this website are Copyrighted.
Your IP: 216.73.216.228     Referring URL:
Browser: Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Terms and Conditions, Privacy Policy, and Security Policy