Created
March 30, 2015 12:33
-
-
Save Na0mir/e5811f10ce1e0b09c821 to your computer and use it in GitHub Desktop.
Get local computer disks status
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ---------------------------------------------- | |
# 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