本帖最后由 terse 于 2013-9-4 13:12 编辑
再学习一个 | GWmi win32_logicaldisk -Filter "DriveType=3" |` | | format-table -autosize @{exp={$_.DeviceID};Lab="盘符"},` | | @{Exp={"{0:N2}" -f ($_.Size/1GB)+" (GB)"};Lab="总容量"},` | | @{Exp={"{0:N2}" -f ($_.FreeSpace/1GB)+" (GB)"};Lab="可用空间"},` | | @{Exp={"{0:N2}" -f (($_.Size-$_.FreeSpace)/1GB)+" (GB)"};Lab="已用空间"},` | | @{Exp={"{0:P2}" -f (($_.size-$_.freespace)/$_.size)};Lab="使用率"} | | Start-Sleep –m 10000COPY |
| GWmi win32_logicaldisk -Filter "DriveType=3" |` | | Format-Table -autosize @{expression={$_.DeviceID};Label="盘符"},` | | @{Expression={($_.Size/1GB).tostring("f2")};Label="总容量(GB)"},` | | @{Expression={($_.FreeSpace/1GB).tostring("f2")};Label="可用空间(GB)"},` | | @{Expression={(($_.Size-$_.FreeSpace)/1GB).tostring("f2")};Label="已用空间(GB)"},` | | @{Expression={(($_.size-$_.freespace)/$_.size*100).tostring("f2")};Label="使用率(%)"} | | Start-Sleep –m 100000COPY |
|