Earlier quoted context omitted.
According to http://stackoverflow.com/a/868290/259130 function directory-summary($dir=".") { get-childitem $dir | % { $f = $_ ; get-childitem -r $_.FullName | measure-object -property length -sum | select @{Name="Name";Expression={$f}},Sum} } I could get a shorter non exact version if I was on windows.
For 'du': > Get-ChildItem C:\windows | Measure-Object -property length -sum Count : 28 Average : Sum : 6407920 Maximum : Minimum : Property : length For 'df': > get-WmiObject win32_logicaldisk DeviceID : C: DriveType : 3 ProviderName : FreeSpace : 21796540416 Size : 31685865472 VolumeName : DeviceID : D: DriveType : 5 ProviderName : FreeSpace : Size : VolumeName : DeviceID : Z: DriveType : 4 ProviderName : \\veertu\s…
For du:
ls C:\Windows\ | measure length -sum
For df: gwmi win32_logicaldisk