How to select top and bottom n rows in PowerShell?

You can use PowerShell cmdlet Select-Object to get top and bottom n rows in PowerShell output. Select-Object works as Unix head or tail command in PowerShell. Let me give you some examples

Get top 10 rows from PowerShell output

Get bottom 10 rows from PowerShell output

Bonus 🙂 – Get unique rows in PowerShell output

Leave a Reply