Get PodeQueryParameter - mdaneri/Pode GitHub Wiki
external help file: Pode-help.xml Module Name: Pode online version: PodeType: Utilities schema: 2.0.0
Retrieves a specific query parameter value from the current Pode web event.
Get-PodeQueryParameter -Name <String> [-ProgressAction <ActionPreference>] [<CommonParameters>]
Get-PodeQueryParameter -Name <String> [-Deserialize] [-NoExplode] [-Style <String>] [-ParameterName <String>]
[-ProgressAction <ActionPreference>] [<CommonParameters>]
The `Get-PodeQueryParameter` function extracts and returns the value of a specified query parameter from the current Pode web event. This function is designed to access query parameters passed in the URL of a web request, enabling the handling of incoming data in web applications.
The function supports deserialization of query parameter values when the `-Deserialize` switch is used, allowing for interpretation of complex data structures from the query string.
Get-PodeQueryParameter -Name 'userId'
Returns the value of the 'userId' query parameter from the current web event.
Get-PodeQueryParameter -Name 'filter' -Deserialize -Style 'SpaceDelimited'
Retrieves and deserializes the value of the 'filter' query parameter, using the 'SpaceDelimited' style.
Get-PodeQueryParameter -Name 'data' -Deserialize -NoExplode
Deserializes the 'data' query parameter value without exploding arrays.
Specifies that the query parameter value should be deserialized. When this switch is used, the value will be interpreted based on the provided style and other deserialization options.
Type: SwitchParameter
Parameter Sets: Deserialize
Aliases:
Required: True
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseThe name of the query parameter to retrieve. This parameter is mandatory.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalsePrevents deserialization from exploding arrays in the query parameter value. This is useful when handling parameters that contain comma-separated values and when array expansion is not desired. Applicable only when the `-Deserialize` switch is used.
Type: SwitchParameter
Parameter Sets: Deserialize
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the key name to use when deserializing the query parameter value. The default value is 'id'. This option is useful for mapping the query parameter data accurately during deserialization. Applicable only when the `-Deserialize` switch is used.
Type: String
Parameter Sets: Deserialize
Aliases:
Required: False
Position: Named
Default value: Id
Accept pipeline input: False
Accept wildcard characters: False{{ Fill ProgressAction Description }}
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseDefines the deserialization style to use when interpreting the query parameter value. Valid options are 'Simple', 'Label', 'Matrix', 'Form', 'SpaceDelimited', 'PipeDelimited', and 'DeepObject'. The default is 'Form'. Applicable only when the `-Deserialize` switch is used.
Type: String
Parameter Sets: Deserialize
Aliases:
Required: False
Position: Named
Default value: Form
Accept pipeline input: False
Accept wildcard characters: FalseThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
This function should be used within a route's script block in a Pode server. The `-Deserialize` switch enables advanced handling of complex query parameter data structures.