Powershell Tip: Find all files larger than X bytes in a directory structure

In order to output all files larger than a certain size on Windows systems, you do not have to use the explorer search. A Powershell script does this very efficiently.

# 100 MB
$min_file_size = 100000000

Get-ChildItem -Recurse -File | Where-Object { $_.Length -ge $min_file_size }  | Select Fullname, Length | Out-GridView

The result is shown in a gridview window:

GridView Ausgabefenster

If the last part | Out-GridView is omitted, the output in the console is required.

Leave a Reply

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