# $Args[0] = "

$Podkatalogi = Get-ChildItem "C:\TEMP\test" -Force  | where { $_.GetType().Name -eq "DirectoryInfo" }


foreach ($Podkatalog in $Podkatalogi)
{

$rozmiar = ($Podkatalog | Get-ChildItem -Recurse  | where { $_.GetType().Name -ne "DirectoryInfo" } |  Measure-Object length -Sum)

Add-Member -InputObject $Podkatalog -Value $rozmiar.Sum -Name "Size" -MemberType "NoteProperty"

}

$Podkatalogi | sort Size | Format-Table Name, Size


