mirror of
https://github.com/sstent/Scripts.git
synced 2026-01-26 07:02:20 +00:00
11 lines
493 B
PowerShell
11 lines
493 B
PowerShell
$startFolder = "C:\"
|
|
|
|
$colItems = (Get-ChildItem $startFolder | Measure-Object -property length -sum)
|
|
"$startFolder -- " + "{0:N2}" -f ($colItems.sum / 1MB) + " MB"
|
|
|
|
$colItems = (Get-ChildItem $startFolder -recurse | Where-Object {$_.PSIsContainer -eq $True} | Sort-Object)
|
|
foreach ($i in $colItems)
|
|
{
|
|
$subFolderItems = (Get-ChildItem $i.FullName | Measure-Object -property length -sum)
|
|
$i.FullName + " -- " + "{0:N2}" -f ($subFolderItems.sum / 1MB) + " MB"
|
|
} |