ConvertTo-TCGdexQueryString

SYNOPSIS

Converts uri filter parameters into a query string

SYNTAX

__AllParameterSets

ConvertTo-TCGdexQueryString [[-UriFilter] <hashtable>]

ALIASES

This cmdlet has the following aliases,

  • None

DESCRIPTION

The ConvertTo-TCGdexQueryString cmdlet converts & formats a hashtable of parameters into a url encoded query string that is later appended to the resource uri of an API call

This is an internal helper function that is used by Invoke-TCGdexRequest

Conversion rules: - $null values are skipped - Keys are sorted (ordinal) so that the same request always creates the same uri - Arrays are joined with a pipe (|), which TCGdex uses to match any of the values - Dates are converted to UTC and formatted as yyyy-MM-ddTHH:mm:ss.fffZ - Booleans are sent as lowercase true\false

EXAMPLES

EXAMPLE 1

ConvertTo-TCGdexQueryString -UriFilter @{ name = 'eq:Pikachu'; 'pagination:page' = 2 }

Returns ‘name=eq%3APikachu&pagination%3Apage=2’

EXAMPLE 2

ConvertTo-TCGdexQueryString -UriFilter @{ name = 'eq:Furret', 'Pikachu' }

Returns ‘name=eq%3AFurret%7CPikachu’

PARAMETERS

-UriFilter

Hashtable of query string parameters

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.String

NOTES

N/A