Skip to content

Get‑NumericalSequence

viscalyxbot edited this page Sep 30, 2025 · 2 revisions

SYNOPSIS

Retrieves numerical sequences from a given set of numbers.

SYNTAX

Get-NumericalSequence [-Number] <Int32> [<CommonParameters>]

DESCRIPTION

The Get-NumericalSequence command retrieves numerical sequences from a given set of numbers. It identifies consecutive numbers and groups them into ranges.

EXAMPLES

EXAMPLE 1

Get-NumericalSequence -Number 1, 2, 3, 5, 6, 7, 10

Returns: Start End


1 3 5 7 10

PARAMETERS

-Number

Specifies the number to be processed. This parameter is mandatory and can be provided via the pipeline.

Type: Int32
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: 0
Accept pipeline input: True (ByValue)
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

System.Int32

Accepts integers from the pipeline for processing.

OUTPUTS

System.Object[]

An array of PSCustomObject objects representing the numerical sequences.

Each object contains the Start and End properties, indicating the start

and end numbers of a sequence.

NOTES

RELATED LINKS

Clone this wiki locally