Trivial no PowerShell.
$FolderSize = Get-ChildItem $FolderPath -Recurse -Force | Measure-Object -Property Length -Sum;
$FolderSize.Sum; #Size in bytes
$FolderSize.Sum / 1MB; #Size in MB
$FolderSize.Sum / 1GB; #Size in GB
Para obter cada pasta em uma pasta especificada e calcular cada uma delas, basta iterar por elas:
$BaseFolder = Get-ChildItem 'C:\Path\To\Folder';
$Results = @();
foreach ($f in $BaseFolder) {
if ($f.PSIsContainer -eq $true) {
$Size = Get-ChildItem $f -Recurse -Force | Measure-Object -Property Length -Sum;
}
else {
$Size = Get-ChildItem $f | Measure-Object -Property Length -Sum;
}
$Results += New-Object PSObject -Property @{Name = $f.Name; Length = $Size.Sum;}
}
$Results | Format-Table -AutoSize;