powershell list usb devices 1

powershell list usb devices

Get-PnpDevice -PresentOnly | Where-Object { $_.InstanceId -match '^USB' }

Here is what the above code is Doing:
1. Get-PnpDevice -PresentOnly
– This gets all the devices that are currently connected to the computer.
2. Where-Object { $_.InstanceId -match ‘^USB’ }
– This filters the results to only show devices that have an InstanceId that starts with USB.

Similar Posts