Get-PC/Private/Get-USB.ps1

15 lines
456 B
PowerShell
Raw Normal View History

2024-06-11 18:27:55 +00:00
#pulls some basic usb device info from the the WMI
function Get-USB {
param(
[string]$comp
)
process{
try {
Get-WmiObject Win32_USBControllerDevice -ComputerName $comp | ForEach-Object {[wmi]($_.Dependent)} | Sort-Object Manufacturer,Description,DeviceID | Format-Table -GroupBy Manufacturer Description,Service,DeviceID
}
catch{
Write-warning 'Unable to grab USB info'
}
}
}