Finding large files with Powershell

Finding all files greater than 1GB with Powershell:

Get-ChildItem -recurse -force -erroraction silentlycontinue | where {$_.Length -gt 1Gb} | ft

If you want to find the 5 largest files, use the following:

Get-ChildItem -recurse -force -erroraction silentlycontinue | where {$_.Length -gt 1Gb} | sort-object -Property Length | select-object -Last 5

This is a bit clunky and slow, but can get the job done. See sample output below:

large_files.png

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s