ConvertTo-PokeAPIQueryString

SYNOPSIS

Converts uri filter parameters

SYNTAX

__AllParameterSets

ConvertTo-PokeAPIQueryString [[-UriFilter] <hashtable>] [-ResourceUri] <string>

ALIASES

This cmdlet has the following aliases,

  • ConvertTo-PokeQueryString

DESCRIPTION

The ConvertTo-PokeAPIQueryString cmdlet converts & formats uri filter parameters from a function which are later used to make the full resource uri for an API call

PokeAPI only accepts the limit & offset query parameters (and q on a self-hosted PokeAPI), all other parameters (Id, Name, AllPages, NoCache, & common parameters) are ignored.

This is an internal helper function the ties in directly with the Invoke-PokeAPIRequest & any public functions that define parameters

EXAMPLES

EXAMPLE 1

ConvertTo-PokeAPIQueryString -UriFilter $PSBoundParameters -ResourceUri '/pokemon'

Example: (From public function) 1x key = https://pokeapi.co/api/v2/pokemon/?limit=100 2x key = https://pokeapi.co/api/v2/pokemon/?limit=100&offset=20 Query = https://myapi.example.com/api/v2/pokemon/?q=pika

PARAMETERS

-ResourceUri

Defines the short resource uri (url) to use when creating the API call

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: 1
  IsRequired: true
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-UriFilter

Hashtable of values to combine a functions parameters with the ResourceUri parameter.

This allows for the full uri query to occur

Type: System.Collections.Hashtable
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: 0
  IsRequired: false
  ValueFromPipeline: true
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

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.Collections.Hashtable

OUTPUTS

System.UriBuilder

NOTES

The ConvertTo-PokeQueryString alias is kept for older scripts.