Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Sort Files by Size PowerShell
Get-ChildItem -Path c:\ -Recurse | Sort-Object Length -Descending | Select-Object length,name,directory -First 100 | Format-Table -AutoSize

This comment has been minimized.

Copy link

@LethalLuggage LethalLuggage commented Jun 10, 2021

If you paste this directly into Powershell it will crash your computer. I'd advise not using C:\ as a base path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment