Powershell: How to find (large) files

Using Microsoft Powershell to find large files on a specific drive recursively is very easy.

Start PowerShell as Admin (run as administrator)

To search for files larger than 100MB on Drive C type:
Get-ChildItem c:\ -Recurse | Where-Object {$_.Length -gt 100MB}
This command can also be entered abbreviated
gci c:\ -rec | where {$_.Length -gt 100mb}

to supress errors like:

Get-ChildItem : Access to the path ‘C:\Windows\System32\LogFiles\WMI\RtBackup’ is denied.
At line:1 char:4
+ gci <<<<  c:\ -rec | where {$_.Length -gt 100mb}
+ CategoryInfo          : PermissionDenied: (C:\Windows\Syst…es\WMI\RtBackup:String) [Get-ChildItem], Unauthoriz
edAccessException
+ FullyQualifiedErrorId : DirUnauthorizedAccessError,Microsoft.PowerShell.Commands.GetChildItemCommand

use the -errorAction instruction

Get-ChildItem c:\ -Recurse -ErrorAction "SilentlyContinue" | Where-Object {$_.Length -gt 100MB}
or
gci c:\ -rec -ErrorAction "SilentlyContinue" | where {$_.Length -gt 100mb}

To export the results to a Microsoft Excel CSV or XML File

Get-ChildItem c:\ -Recurse -ErrorAction "SilentlyContinue" | Where-Object {$_.Length -gt 100MB} | Export-Csv c:\temp\myLargeFilesOnC_Report.csv
or
Get-ChildItem c:\ -Recurse -ErrorAction "SilentlyContinue" | Where-Object {$_.Length -gt 100MB} | Export-Clixml c:\temp\myLargeFilesOnC_report.xml

feel free to comment!