Created
August 5, 2019 09:36
-
-
Save a4099181/f620aeb79d485603aae908bf985ac8fe to your computer and use it in GitHub Desktop.
Powershell script to calculate directory size. Lists all directories in a current directory. Calculates and prints a size for each of them (dirstat, folder statistics).
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
Get-ChildItem -Directory | | |
Select-Object ` | |
@{ N="Directory"; E={ $_.Name } }, ` | |
@{ N="Size"; E={ (Get-ChildItem -Recurse -File -Path $_.FullName | Measure-Object -Property Length -Sum).Sum } } | | |
Sort-Object -Property Size -Descending |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment