April 21st, 2014

PowerTip: Use PowerShell to Find Size of User Profile

Doctor Scripto
Scripter

Summary: Use Windows PowerShell to find the size of your user profile.

Hey, Scripting Guy! Question How can I use Windows PowerShell to find the size of my user profile and to see the size of the largest file in my profile?

Hey, Scripting Guy! Answer Use the Get-ChildItem cmdlet, recurse through your profile directory, pipe the results to
          the Measure-Object cmdlet, select the Length property, and add Sum and Maximum.
          This command measures the ED directory, and dir is an alias for Get-ChildItem:

PS C:\Users> dir .\ed -Recurse | Measure-Object -Property length -Sum -Maximum

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.