Skip to content

ConvertTo HttpQueryString

apobekiaris edited this page Sep 4, 2020 · 5 revisions

external help file: XpandPwsh-help.xml Module Name: XpandPwsh online version: schema: 2.0.0

ConvertTo-HttpQueryString

SYNOPSIS

Converts a Hastable to an HttpQueryString.

SYNTAX

ConvertTo-HttpQueryString [[-Values] <Hashtable>] [[-Variables] <String[]>] [<CommonParameters>]

DESCRIPTION

Converts a Hastable to an HttpQueryString.

EXAMPLES

Example 1

PS C:\> if (!$Id){
            $query = ConvertTo-HttpQueryString @{
                '$top'       = $top
                '$skip'      = $Skip
                reasonFilter = $Reason
                statusFilter = ($Status -join ",")
                resultFilter = $Result
                tagFilters   = ($Tag -join ",")
                definitions  = (($Definition|Where-Object{$_} | Get-AzDefinition).id -join ",")
            }
            $resource="build/builds$query"
        }
        Invoke-AzureRestMethod $resource @cred

Converts a hashtable into a query string and performs a web request.

PARAMETERS

-Values

{{ Fill Values Description }}

Type: Hashtable
Parameter Sets: (All)
Aliases:

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

-Variables

{{ Fill Variables Description }}

Type: String[]
Parameter Sets: (All)
Aliases:

Required: False
Position: 1
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

None

OUTPUTS

System.Object

NOTES

RELATED LINKS

image

image


Star the project if you think it deserves it.

GitHub stars

Fork the project to extend and contribute.

GitHub forks

Clone this wiki locally