PowerTip: Find Largest File in User Profile with PowerShell

The Scripting Guys

Dr Scripto

Summary: Use Windows PowerShell to find the largest file in your user profile.

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

Hey, Scripting Guy! Answer Use the Get-ChildItem cmdlet (dir is an alias for the Get-ChildItem), do a recursive search
          of your user profile directory, then sort the files by size and select the last file:

dir $env:USERPROFILE -Recurse -File | sort length | select -last http://devblogs.microsoft.com/scripting/wp-content/uploads/sites/29/20http://devblogs.microsoft.com/scripting/wp-content/uploads/sites/29/20http://devblogs.microsoft.com/scripting/wp-content/uploads/sites/29/20http://devblogs.microsoft.com/scripting/wp-content/uploads/sites/29/20http://devblogs.microsoft.com/scripting/wp-content/uploads/sites/29/20http://devblogs.microsoft.com/scripting/wp-content/uploads/sites/29/20http://devblogs.microsoft.com/scripting/wp-content/uploads/sites/29/2019/04/2010_scriptgames_badge1.png9/04/hsg_perf3_02.jpg9/04/hsg_perf4_0http://devblogs.microsoft.com/scripting/wp-content/uploads/sites/29/20http://devblogs.microsoft.com/scripting/wp-content/uploads/sites/29/2019/04/2010_scriptgames_badge1.png9/04/hsg_perf3_02.jpg.jpg9/04/hsg-02-http://devblogs.microsoft.com/scripting/wp-content/uploads/sites/29/20http://devblogs.microsoft.com/scripting/wp-content/uploads/sites/29/20http://devblogs.microsoft.com/scripting/wp-content/uploads/sites/29/2019/04/2010_scriptgames_badge1.png9/04/hsg_perf3_02.jpg9/04/hsg_perf4_0http://devblogs.microsoft.com/scripting/wp-content/uploads/sites/29/20http://devblogs.microsoft.com/scripting/wp-content/uploads/sites/29/2019/04/2010_scriptgames_badge1.png9/04/hsg_perf3_02.jpg.jpg7-http://devblogs.microsoft.com/scripting/wp-content/uploads/sites/29/20http://devblogs.microsoft.com/scripting/wp-content/uploads/sites/29/20http://devblogs.microsoft.com/scripting/wp-content/uploads/sites/29/2019/04/2010_scriptgames_badge1.png9/04/hsg_perf3_02.jpg9/04/hsg_perf4_0http://devblogs.microsoft.com/scripting/wp-content/uploads/sites/29/20http://devblogs.microsoft.com/scripting/wp-content/uploads/sites/29/2019/04/2010_scriptgames_badge1.png9/04/hsg_perf3_02.jpg.jpg0-03.jpg9/04/questsoftware.png9/04/a-sm.jpg9/04/q-sm.jpg

The Scripting Guys
Dr Scripto

Follow Dr Scripto   

No Comments.