Below is small snippet that can be used to get the list of all the usb devices installed.
# Get all USB devices
$usbDevices = Get-PnpDevice -Class USB
# Output information about each USB device
foreach ($device in $usbDevices) {
Write-Output "Device ID: $($device.InstanceId)"
Write-Output "Description: $($device.Description)"
Write-Output "Manufacturer: $($device.Manufacturer)"
Write-Output "Status: $($device.Status)"
Write-Output "-----------------------------"
}
Hope this was easy to understand the code.
Thanks!
No comments:
Post a Comment