Count the ghost devices first
**Get-PnpDevice** lists present and non-present devices separately. The count of non-present entries shows whether a cleanup is worth the risk.
Get-PnpDevice | Group-Object Present | Select-Object Name,Count
Get-PnpDevice -PresentOnly | Measure-Object
(Get-PnpDevice | Where-Object { -not $_.Present }).Count