Tuesday, April 7, 2015

PowerShell - Check Hard Drive Size

 Get C: Drive size
$disk = ([wmi]"\root\cimv2:Win32_logicalDisk.DeviceID='C:'")
"C: has {0:#.0} GB free of {1:#.0} GB Total" -f ($disk.FreeSpace/1GB),($disk.Size/1GB) | write-output

No comments:

Post a Comment