My successful one-liner in PowerShell is:
http://woshub.com/powershell-get-folder-sizes/
The commands shown above allow you to get only the total size of files in the specified directory. If there are subfolders in the directory, the size of files in the subfolders won’t be calculated. To get the total size of files in the directory taking subfolders into account, use the –Recurse parameter. Let’s get the total size of files in the C:\Windows directory:
"{0:N2} GB" -f ((gci –force c:\Windows –Recurse -ErrorAction SilentlyContinue| measure Length -s).sum / 1Gb)
No comments:
Post a Comment