Created
April 6, 2020 04:36
-
-
Save skurscheid/2b615647bbb65ec4a2d178e913aa51f6 to your computer and use it in GitHub Desktop.
Windows PowerShell: list subdirectories including size on disk in GB
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
gci -force 'C:\Users'-ErrorAction SilentlyContinue | ? { $_ -is [io.directoryinfo] } | % { | |
$len = 0 | |
gci -recurse -force $_.fullname -ErrorAction SilentlyContinue | % { $len += $_.length } | |
$_.fullname, '{0:N2} GB' -f ($len / 1Gb) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment