ConvertTo-vPenTestQueryString
SYNOPSIS
Converts uri filter parameters into a query string
SYNTAX
__AllParameterSets
ConvertTo-vPenTestQueryString [[-UriFilter] <hashtable>] [[-MultiValueParameter] <string[]>]
ALIASES
This cmdlet has the following aliases,
- None
DESCRIPTION
The ConvertTo-vPenTestQueryString 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-vPenTestRequest
Conversion rules: - $null values are skipped - Arrays are sent as comma separated lists - Dates are converted to UTC and formatted as yyyy-MM-ddTHH:mm:ss.fffZ - Booleans are sent as lowercase true\false - Hashtables & objects are sent as compressed JSON
EXAMPLES
EXAMPLE 1
ConvertTo-vPenTestQueryString -UriFilter @{ limit = 10; ids = 1,2,3 }
Returns ‘ids=1,2,3&limit=10’
EXAMPLE 2
ConvertTo-vPenTestQueryString -UriFilter @{ states = 'active','expired' } -MultiValueParameter 'states'
Returns ‘states=active&states=expired’
PARAMETERS
-MultiValueParameter
Defines the names of the UriFilter keys that must be sent as repeated key\value pairs instead of a comma separated list
Type: System.String[]
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 1
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-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
NOTES
N/A