Skip to content

Latest commit

 

History

History
104 lines (78 loc) · 3.64 KB

Sort-ObjectGraph.md

File metadata and controls

104 lines (78 loc) · 3.64 KB

ConvertTo-SortedObjectGraph

Sort object graph

Syntax

ConvertTo-SortedObjectGraph
    -InputObject <Object>
    [-PrimaryKey <String[]>]
    [-MatchCase]
    [-Descending]
    [-MaxDepth <Int32> = [PSNode]::DefaultMaxDepth]
    [<CommonParameters>]

Description

Recursively sorts a object graph.

Parameters

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