标签:container value sort div psi contain containe get -o
function filesize ([string]$filepath) { if ($filepath -eq $null) { throw "路径不能为空" } $hash_size=@{} dir -Path $filepath | ForEach-Object -Process { if ($_.psiscontainer -eq $true) { $length = 0 dir -Path $_.fullname -Recurse | ForEach-Object{ $length += $_.Length } $l = $length/1MB [int]$FolderSIZE=" {0:n1}" -f $l $hash_size.($_.name)=$FolderSIZE } } $hash_size.GetEnumerator() | Sort-Object Value } filesize -filepath ".\"
标签:container value sort div psi contain containe get -o
原文地址:http://www.cnblogs.com/cm20121009/p/6965031.html