powershell 获取文件夹的大小
$startFolder = "C:\users"
$colItems = (Get-ChildItem $startFolder | Where-Object {$_.PSIsContainer -eq $True} | Sort-Object)
foreach ($i in $colItems)
{
$subFolderItems = (Get-ChildItem $i.FullName -recurse | Measure-Object -property length -sum)
$i.FullName + " -- " + "{0:N2}" -f ($subFolderItems.sum / 1MB) + " MB"
}
标签:Get,Object,subFolderItems,获取,文件夹,colItems,powershell From: https://www.cnblogs.com/wulongy/p/17753924.html