Skip to content

Split-URI

SYNOPSIS

Takes a given URI and splits it into its constituent parts.

SYNTAX

Split-URI [-InputObject] <String[]> [-AsHashtable] [<CommonParameters>]

DESCRIPTION

This will split a given URI into its relevant parts, protocol/domain/subdomain/hostname and the full URI.

EXAMPLES

Example 1: Split URL

'https://www.example.com/' | Split-URI

Protocol  : https
Domain    : com
Subdomain : www
Hostname  : example
URI       : https://www.example.com/

Splits the given URL into the parts listed above.

PARAMETERS

-AsHashtable

Returns a hashtable instead of a PS object

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

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

-InputObject

The URI to be split

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

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

CommonParameters

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

INPUTS

System.String[]

OUTPUTS

System.Object

NOTES