Created
August 25, 2016 17:03
-
-
Save jrwarwick/ff1cf0ae885bc4ecce745b080002fa22 to your computer and use it in GitHub Desktop.
In current working directory, list subfolders that contain at least 100MB in files.
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 -Force | Where-Object { $_.PSIsContainer } | ForEach-Object { $_.Name + ": " + "{0:N2}" -f ((Get-ChildItem $_ -Recurse | Measure-Object Length -Sum -ErrorAction SilentlyContinue).Sum / 1MB) + " MB" } | % { if ($_ -notmatch ': [0-9]{1,2}\.') {$_;} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Interesting note: on a recent edition of Windows, when the disk was too full, this command would, without error, just lie about disk usage. Entire subdirectories would be reported as 0-bytes. Of course this sort of tool is most needed when you have such exhausted conditions. Caveat Emptor.