April 28th, 2014

PowerTip: Use PowerShell to Find USB Drives

Doctor Scripto
Scripter

Summary: Use Windows PowerShell 4.0 function to find USB drives on Windows 8.1.

Hey, Scripting Guy! Question How can I use Windows PowerShell to find how many drives attached to my system are using USB interfaces?

Hey, Scripting Guy! Answer Open Windows PowerShell 4.0 in Windows 8.1 with admin rights, use the Get-Disk function
          to find all disk objects, and then filter for a bustype of USB:

get-disk | where bustype -eq 'usb'

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.