test.bat- @echo off
- powershell -f test.ps1 > 1.txt
复制代码 test.ps1- gwmi win32_logicaldisk -filter "drivetype = 3" | % {
- $_.deviceid + "`t" + `
- ($_.size/1GB).tostring("f2") + "`t`t" + `
- ($_.freespace/1GB).tostring("f2") + "`t`t" + `
- ($_.size/1GB-$_.freespace/1GB).tostring("f2") + "`t`t" + `
- (($_.size-$_.freespace)/$_.size*100).tostring("f2") + "%"
- }
复制代码
|