Selecting and sorting
Select-Object
acts on an input pipeline, either an existing collection of objects or the output from another command. Select-Object
can be used to select a subset of properties, to change properties, or to add new properties. Select-Object
also allows a user to limit the number of objects returned.
Sort-Object
can be used to perform both simple and complex sorting based on an input pipeline.
Using Select-Object
is a key part of working with PowerShell, output can be customized to suit circumstances in several ways.
The Select-Object command
Select-Object
is an extremely versatile command as shown by each of the following short examples, which demonstrate some of the simpler uses of the command.
Select-Object
can be used to explore what is available on an object by using a wildcard for the Property
parameter:
Get-Process -Id $PID | Select-Object *
This can be a handy way of viewing all available properties and sometimes a useful alternative...