Situatie
You can use PowerShell to report all the USB devices installed on your system. Here’s a script you can use:
Solutie
# Get all USB devices connected to the computer
$usbDevices = Get-PnpDevice | Where-Object {$_.Class -eq “USB”}
# Display information about each USB device
foreach ($device in $usbDevices) {
$deviceName = $device.FriendlyName
$deviceId = $device.InstanceId
$deviceDescription = $device.DeviceDescription
Write-Host “Device Name: $deviceName”
Write-Host “Device ID: $deviceId”
Write-Host “Device Description: $deviceDescription”
Write-Host “———————————–”
}
This script retrieves all PnP (Plug and Play) devices and filters out those with the class “USB”. Then, it iterates over each USB device, extracting its name, instance ID, and description, and prints out the information. You can run this script in a PowerShell environment to see a list of connected USB devices.
Leave A Comment?