How Do You Find Files on the C: Drive That Are Greater than 20 MB?

Problem scenario
Using PowerShell, how do you retrieve all files that are greater than 20 MB?

Solution
Run a command like this:

Get-ChildItem C:\ -recurse | where-object {$_.length -gt 20971520} | Sort-Object length | ft fullname, length -auto

This was adapted from this external website.

Leave a comment

Your email address will not be published. Required fields are marked *