Get-WmiObject -Class Win32_LogicalDisk -Filter "DriveType=3" |
Format-Table deviceid,
@{Label="free(GB)"; Expression={($_.freespace/1GB).tostring("f1")}},
@{Label="size(GB)"; Expression={($_.size/1GB).tostring("f1")}},
@{Label="percentage(%)";Expression={"{0:p}" -f($_.freespace/$_.size)}}-AutoSize
原文:http://www.cnblogs.com/dreamer-fish/p/3898829.html