Created
March 7, 2013 16:36
-
-
Save MarcStoecker/5109419 to your computer and use it in GitHub Desktop.
Display Total Folder Size with PowerShell and Sort by Size (can take a while if many levels to work down to)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ls -Force | Add-Member -Force -Passthru -Type ScriptProperty -Name Length -Value {ls $this -Recurse -Force | Measure -Sum Length | Select -Expand Sum } | Sort-Object Length -Descending | Format-Table @{label="TotalSize (MB)";expression={[Math]::Truncate($_.Length / 1MB)};width=14}, @{label="Mode";expression={$_.Mode};width=8}, Name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment