COMMAND EVERYTHING.
Take the first three items from an ordered input stream.
PowerShell · Risk: Low · Documentation VerifiedLast verified: 2026-10-26
Returns one, two, and three. This operation selects objects rather than sorting them.
Select-Object [-InputObject <PSObject>] [[-Property] <Object[]>]
[-ExcludeProperty <String[]>] [-ExpandProperty <String>] [-Unique] [-CaseInsensitive]
[-Last <Int32>] [-First <Int32>] [-Skip <Int32>] [-Wait] [<CommonParameters>]Copied 0 timesNo elevation is required for the in-memory examples. Filesystem operations require read or traversal access to the selected path.
PowerShell · 7.6; filesystem examples require the FileSystem provider
-FirstPowerShell 7.6 with Microsoft.PowerShell.Utility. For file examples, replace the sample path with an accessible file or directory.
Low risk for the supplied example. Protect file contents, paths, and returned system metadata. Review any modifications to the example before execution.
1..10 | Select-Object -First 3Returns one, two, and three. This operation selects objects rather than sorting them.
Sign in to keep your own command reference lists.
Explain or customize this command with AI