Skip to content

Instantly share code, notes, and snippets.

@atifaziz
Created April 22, 2013 06:53
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save atifaziz/5432908 to your computer and use it in GitHub Desktop.
Save atifaziz/5432908 to your computer and use it in GitHub Desktop.
Get-WmiObject Win32_LogicalDisk |
? { $_.DriveType -eq 3 } |
Select DeviceID,
@{ Name = 'FreeSpaceMB'; Expression = { $_.FreeSpace / 1MB } },
@{ Name = 'SizeMB'; Expression = { $_.Size / 1MB } },
@{ Name = 'FreeSpacePct'; Expression = { $_.FreeSpace / $_.Size } }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment