Created
February 17, 2016 06:39
-
-
Save ArockiaAntony/e3982e7fcc8a44381b71 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#Get Logical Parition usage in percentage | |
#Written by Arockia | |
Get-WmiObject win32_logicaldisk -Filter "DriveType=3" | select DeviceID,Size,Freespace | Format-Table -Property DeviceID,@{name="Total_Space";expression={[math]::Round(($_.Size/1MB)/1024,2).ToString()+" GB"}},@{name="Free_Space";expression={[math]::Round(($_.Freespace/1MB)/1024,2).ToString()+" GB"}}, @{name="Usage Percentage";expression={[math]::Round(((([math]::Round(($_.Size/1MB)/1024,2)-[math]::Round(($_.Freespace/1MB)/1024,2))/[math]::Round(($_.Size/1MB)/1024,2))*100),2).ToString()+" %"}} -AutoSize |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment