Skip to content

List-UsbDevices

Lists USB devices

try {
	Get-PnpDevice | Where-Object {$_.Class -eq "USB"} | Sort-Object -property FriendlyName | Format-Table -property FriendlyName,Status,InstanceId
	exit 0 # success
} catch {
	"?? ERROR: $($Error[0]) (script line $($_.InvocationInfo.ScriptLineNumber))"
	exit 1
}

This script has no configurable parameters.

An interactive directory of PowerShell scripts.