December 20th, 2015

PowerTip: Determine Size of Folder with PowerShell

Doctor Scripto
Scripter

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

Category
Scripting

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.