How do I find the 10 largest files in a directory structure

Try this script

Get-ChildItem -re -in * |
  ?{ -not $_.PSIsContainer } |
  sort Length -descending |
  select -first 10

Breakdown:

The filter block “?{ -not $_.PSIsContainer }” is meant to filter out directories. The sort command will sort all of the remaining entries by size in descending order. The select clause will only allow the first 10 through so it will be the largest 10.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)