PowerTip: Determine Size of Folder with PowerShell

Doctor Scripto

Summary: Use Windows PowerShell to determine the size of a folder.

Hey, Scripting Guy! Question How can I use Windows PowerShell to easily get the size of a folder structure?

Hey, Scripting Guy! Answer Use a combination of Get-Childitem and Measure-Object. For example, to see the size of the C:\Foo folder
           structure in Windows PowerShell 5.0 or 4.0, use:

Get-Childitem C:\Foo –file –recurse | Measure-Object –property Length -sum


Discussion is closed.

Feedback usabilla icon