November 2018
Intermediate to advanced
566 pages
17h 15m
English
This recipe is another demonstration of passing objects through the pipeline. In the help documentation for Sort-Object, we can see a parameter called InputObject. This parameter is a generic term used in PowerShell for a parameter whose input comes through the pipeline.
Sort-Object accepts input from the pipeline, and sorts the content based on the property specified. If a property is not specified, the default property for the object output from the preceding command is used for sorting. If there are multiple properties being used as input, the sorting happens based on the order in which the properties are specified.
Sorting can happen in ascending order (default) or descending order.
Read now
Unlock full access