PowerShell Version 5 New Feature: SkipLast Parameter added to Select-Object

I’m picking up where I left off in my last blog article on the new features in the PowerShell version 5 preview. Today I be covering a new parameter, SkipLast that has been added to the Select-Object cmdlet.

I have a text file where I saved a list of the available packages in the default OneGet Chocolatey repository. There are a total of 1893 items in this file:

(Get-Content -Path C:\demo\packages.txt).count

ps5-skiplast1.jpg

I’ll use the new SkipLast parameter to skip the last 1885 items:

Get-Content -Path C:\demo\packages.txt | Select-Object -SkipLast 1885

ps5-skiplast2.jpg

This blog article is one of many that I’ve written and will be writing about the new features in PowerShell version 5. You can find my other blog articles on PowerShell version 5 here.

µ