Skip to content

Latest commit

 

History

History
283 lines (222 loc) · 6.97 KB

Get-ShlinkUrl.md

File metadata and controls

283 lines (222 loc) · 6.97 KB
external help file Module Name online version schema
PSShlink-help.xml
PSShlink
2.0.0

Get-ShlinkUrl

SYNOPSIS

Get details of all short codes, or just one.

SYNTAX

ListShortUrls (Default)

Get-ShlinkUrl [-SearchTerm <String>] [-Tags <String[]>] [-TagsMode <String>] [-OrderBy <String>]
 [-StartDate <DateTime>] [-EndDate <DateTime>] [-ExcludeMaxVisitsReached] [-ExcludePastValidUntil]
 [-ShlinkServer <String>] [-ShlinkApiKey <SecureString>] [<CommonParameters>]

ParseShortCode

Get-ShlinkUrl -ShortCode <String> [-Domain <String>] [-ShlinkServer <String>] [-ShlinkApiKey <SecureString>]
 [<CommonParameters>]

DESCRIPTION

Get details of all short codes, or just one. Various filtering options are available from the API to ambigiously search for short codes.

EXAMPLES

EXAMPLE 1

Get-ShlinkUrl

Returns all short codes with no filtering applied.

EXAMPLE 2

Get-ShlinkUrl -ShortCode "profile"

Returns the short code "profile".

EXAMPLE 3

Get-ShlinkUrl -ShortCode "profile" -Domain "example.com"

Returns the short code "profile" using the domain "example.com". This is useful if your Shlink instance is responding/creating short URLs for multiple domains.

EXAMPLE 4

Get-ShlinkUrl -Tags "oldwebsite", "evenolderwebsite" -TagsMode "any" -OrderBy "dateCreated-ASC"

Returns short codes which are associated with the tags "oldwebsite" or "evenolderwebsite". Ordered by the dateCreated property in ascending order.

EXAMPLE 5

Get-ShlinkUrl -StartDate (Get-Date "2020-10-25 11:00:00")

Returns short codes which have a start date of 25th October 2020 11:00:00 AM or newer. If a start date was not configured for the short code(s), this filters on the dateCreated property.

EXAMPLE 6

Get-ShlinkUrl -SearchTerm "microsoft"

Returns the short codes which match the search term "microsoft".

PARAMETERS

-ShortCode

The name of the short code you wish to search for. For example, if the short URL is "https://example.com/new-url" then the short code is "new-url".

Type: String
Parameter Sets: ParseShortCode
Aliases:

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

-Domain

The domain (excluding schema) associated with the short code you wish to search for. For example, "example.com" is an acceptable value. This is useful if your Shlink instance is responding/creating short URLs for multiple domains.

Type: String
Parameter Sets: ParseShortCode
Aliases:

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

-SearchTerm

The search term to search for a short code with.

Type: String
Parameter Sets: ListShortUrls
Aliases:

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

-Tags

One or more tags can be passed to find short codes using said tag(s).

Type: String[]
Parameter Sets: ListShortUrls
Aliases:

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

-TagsMode

Tells how the filtering by tags should work, returning short URLs containing "any" of the tags, or "all" the tags. It's ignored if no tags are provided, and defaults to "any" if not provided.

Type: String
Parameter Sets: ListShortUrls
Aliases:

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

-OrderBy

Order the results returned by "longUrl-ASC", "longUrl-DESC", "shortCode-ASC", "shortCode-DESC", "dateCreated-ASC", "dateCreated-DESC", "visits-ASC", "visits-DESC", "title-ASC", "title-DESC".

Type: String
Parameter Sets: ListShortUrls
Aliases:

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

-StartDate

A datetime object to search for short codes where its start date is equal or greater than this value. If a start date is not configured for the short code(s), this filters on the dateCreated property.

Type: DateTime
Parameter Sets: ListShortUrls
Aliases:

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

-EndDate

A datetime object to search for short codes where its end date is equal or less than this value.

Type: DateTime
Parameter Sets: ListShortUrls
Aliases:

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

-ExcludeMaxVisitsReached

Short URLs which already reached their maximum amount of visits will be excluded.

Type: SwitchParameter
Parameter Sets: ListShortUrls
Aliases:

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

-ExcludePastValidUntil

Short URLs which validUntil date is on the past will be excluded.

Type: SwitchParameter
Parameter Sets: ListShortUrls
Aliases:

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

-ShlinkServer

The URL of your Shlink server (including schema). For example "https://example.com". It is not required to use this parameter for every use of this function. When it is used once for any of the functions in the PSShlink module, its value is retained throughout the life of the PowerShell session and its value is only accessible within the module's scope.

Type: String
Parameter Sets: (All)
Aliases:

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

-ShlinkApiKey

A SecureString object of your Shlink server's API key. It is not required to use this parameter for every use of this function. When it is used once for any of the functions in the PSShlink module, its value is retained throughout the life of the PowerShell session and its value is only accessible within the module's scope.

Type: SecureString
Parameter Sets: (All)
Aliases:

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

This function does not accept pipeline input.

OUTPUTS

System.Management.Automation.PSObject

Objects have a PSTypeName of 'PSShlink'.

NOTES

RELATED LINKS