Sort object graph
ConvertTo-SortedObjectGraph
-InputObject <Object>
[-PrimaryKey <String[]>]
[-MatchCase]
[-Descending]
[-MaxDepth <Int32> = [PSNode]::DefaultMaxDepth]
[<CommonParameters>]
Recursively sorts a object graph.
The input object that will be recursively sorted.
Note
Multiple input object might be provided via the pipeline. The common PowerShell behavior is to unroll any array (aka list) provided by the pipeline. To avoid a list of (root) objects to unroll, use the comma operator:
,$InputObject | Sort-Object.
Type: | Object |
Mandatory: | True |
Position: | Named |
Default value: | |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Any primary key defined by the -PrimaryKey parameter will be put on top of -InputObject independent of the (descending) sort order.
It is allowed to supply multiple primary keys.
Type: | String[] |
Mandatory: | False |
Position: | Named |
Default value: | |
Accept pipeline input: | False |
Accept wildcard characters: | False |
(Alias -CaseSensitive
) Indicates that the sort is case-sensitive. By default, sorts aren't case-sensitive.
Type: | SwitchParameter |
Mandatory: | False |
Position: | Named |
Default value: | |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Indicates that Sort-Object sorts the objects in descending order. The default is ascending order.
Note
Primary keys (see: -PrimaryKey) will always put on top.
Type: | SwitchParameter |
Mandatory: | False |
Position: | Named |
Default value: | |
Accept pipeline input: | False |
Accept wildcard characters: | False |
The maximal depth to recursively compare each embedded property (default: 10).
Type: | Int32 |
Mandatory: | False |
Position: | Named |
Default value: | [PSNode]::DefaultMaxDepth |
Accept pipeline input: | False |
Accept wildcard characters: | False |