Commands / Text and objects

Select-Object

Pick properties or the first N objects

beginner Text and objects Aliases select

Select-Object
 Get-ChildItem | Select-Object -First 5 Name, Length
Works on
WindowsLinuxmacOS
PowerShell
5.1 and later
Reference
Microsoft Learn: Select-Object

Two jobs: cut the list (-First, -Last, -Skip) and cut the shape (-Property).

Select-Object Name, Length returns slim objects with those properties only.

Try this

Get-Process | Select-Object -First 10 Name, CPU, WorkingSet

Coming from another shell

ShellWhat you might type
bash / zshls | head -5

More in From bash and From cmd.

Related commands