Created
September 8, 2020 07:16
-
-
Save HainanZhao/61ae8ac02cba28934177c2a1b6f98209 to your computer and use it in GitHub Desktop.
List sub folder size using 1 line command
This file contains hidden or 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
| Get-ChildItem -Directory -Force|ForEach {"{0,-40}| {1:N2}MB" -f $_.name, ((Get-ChildItem $_ -Recurse|Measure-Object -Property Length -Sum -ErrorAction Stop).Sum/1MB)} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment