your-command | select -First #for example Get-Process | select -First 3 cat filename | select -First 3