Skip to main content

Format-IPList

SYNOPSIS

Takes a list of IP addresses and sorts them.

SYNTAX

Format-IPList [-IPAddress] <IPAddress[]> [<CommonParameters>]

DESCRIPTION

This function takes a list of IP addresses and sorts them in the appropriate order.

EXAMPLES

EXAMPLE 1

Format-IPList -IPAddress 127.0.0.5, 127.0.0.100, 10.0.1.5, 10.0.1.1, 10.0.1.100
Sorts the given list of IP addresses in the correct order.

EXAMPLE 2

Sort-IPs 127.0.0.5, 127.0.0.100, 10.0.1.5, 10.0.1.1, 10.0.1.100
Uses the alias Sort-IPs to sort the list of IP addresses.

PARAMETERS

-IPAddress

Used to specify the IP addresses that you wish to sort.

Type: IPAddress[]
Parameter Sets: (All)
Aliases: IP, IPs, IPv4, Address, IPAddresses

Required: True
Position: 1
Default value: None
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

OUTPUTS

System.Object

NOTES

ALIASES

None.

PLATFORM APPLICABILITY

Windows, macOS, and Linux.

POWERSHELL COMPATIBILITY

See PowerShell compatibility for the supported runtime policy. PowerShell 7.6 LTS is preferred.

https://docs.keldor.dev/powershell/keldor/Format-IPList