Skip to content

Instantly share code, notes, and snippets.

@ljmccarthy
Last active March 25, 2019 10:53
Show Gist options
  • Save ljmccarthy/3b4441ece4c3a9189b5343591a0cbd9f to your computer and use it in GitHub Desktop.
Save ljmccarthy/3b4441ece4c3a9189b5343591a0cbd9f to your computer and use it in GitHub Desktop.
List removable writable drives on Windows
Get-WmiObject -Class Win32_DiskDrive |
Where-Object {$_.Capabilities -contains 3 -and $_.MediaType -eq "Removable Media"} |
Select-Object Caption, Size, SerialNumber, InterfaceType, DeviceID, Status
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment