開発環境 |
PSVersion 4.0 |
実行環境 |
Microsoft Windows 8.1 (64bit) |
プロジェクト名 |
bigfile |
大きいファイル一覧
参考
bigfile.ps1
# bigfile.ps1
$dir = "C:\backup\picture"
Get-ChildItem $dir -Recurse |
where {$_.length -GT 10MB} |
sort -Descending length |
Format-Table `
@{Name="サイズ(MB)"; Expression={($_.length/1MB).ToString("0.00")}},
@{Name="パス($dir)"; Expression={$_.fullname.Replace($dir, "")}} `
-AutoSize
ファイル集計
filesum.ps1
Get-ChildItem C:\backup\picture -Recurse -Force |
measure length -Sum -Average
出力
PS C:\Projects\PowerShell> .\filesum.ps1
Count : 115802
Average : 252593.627182605
Sum : 29250847215
Maximum :
Minimum :
Property : length
最終更新:2014年04月17日 18:39