Created
January 2, 2018 10:13
-
-
Save Kyu/bc50ddcdabe2fc5136c66240740f3bd2 to your computer and use it in GitHub Desktop.
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
#from: https://stackoverflow.com/a/26494912 | |
$colItems = Get-ChildItem $startFolder | Where-Object {$_.PSIsContainer -eq $true} | Sort-Object | |
foreach ($i in $colItems) | |
{ | |
$subFolderItems = Get-ChildItem $i.FullName -recurse -force | Where-Object {$_.PSIsContainer -eq $false} | Measure-Object -property Length -sum | Select-Object Sum | |
$i.FullName + " -- " + "{0:N2}" -f ($subFolderItems.sum / 1MB) + " MB" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment