Quantcast
Channel: Hey, Scripting Guy! Blog
Viewing all articles
Browse latest Browse all 3333

PowerTip: Show attached USB Drives with PowerShell

$
0
0

Summary: Use Windows PowerShell to show attached USB drives.

Hey, Scripting Guy! Question Is there an easy way with Windows PowerShell to show all drives that are connected via USB?

Hey, Scripting Guy! AnswerUse Get-WMIObject and query win32_diskdrive:

GET-WMIOBJECT win32_diskdrive | Where { $_.InterfaceType –eq ‘USB’ }

Or...

Write this as a query and pass it directly to WMI:

GET-WMIOBJECT –query “SELECT * from win32_diskdrive where InterfaceType = ‘USB’”


Viewing all articles
Browse latest Browse all 3333

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>