Skip to content

Add-SnowOrderBy

SYNOPSIS

Adds a field sort to a ServiceNow encoded query.

SYNTAX

Add-SnowOrderBy [-Field] <String[]> [-Descending] [-Table <String>] [-Query <String>]
 [-ProgressAction <ActionPreference>] [<CommonParameters>]

DESCRIPTION

{{ Fill in the Description }}

EXAMPLES

EXAMPLE 1

New-SnowQuery -Conditions @{ active = 'true' } | Add-SnowOrderBy number

Sorts by incident number ascending.

EXAMPLE 2

'active=true' | Add-SnowOrderBy sys_created_on -Descending

Newest records first.

PARAMETERS

-Field

One or more fields to sort by.

Type: String[]
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Descending

Sorts descending instead of ascending.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-Table

The table used for field tab completion.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Query

The existing query, normally from the pipeline.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False

-ProgressAction

{{ Fill ProgressAction Description }}

Type: ActionPreference
Parameter Sets: (All)
Aliases: proga

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

OUTPUTS

System.String

NOTES