Skip to content

Instantly share code, notes, and snippets.

@Na0mir
Created March 30, 2015 12:33
Show Gist options
  • Save Na0mir/e5811f10ce1e0b09c821 to your computer and use it in GitHub Desktop.
Save Na0mir/e5811f10ce1e0b09c821 to your computer and use it in GitHub Desktop.
Get local computer disks status
# ----------------------------------------------
# Author: Romain Blanchard
# Date: 28.06.2012
# Description: Get local computer disks status
# ----------------------------------------------
# -- Script -- #
write-host ""
write-host "---------- Disk status ----------" -ForegroundColor Yellow
Get-WmiObject Win32_LogicalDisk | Where-Object {$_.DriveType -eq 3} |
Select-Object Name, VolumeName, @{Name="Size";Expression={"{0:N1} GB" -f($_.Size/1gb)}},@{Name="FreeSpace";Expression={"{0:N1} GB" -f($_.Freespace/1gb)}},@{Name=" %% ";Expression={"{0:P0}" -f($_.freespace/$_.Size)}} |
Format-Table
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment