Skip to main content

Invoke-HaloRequest

Generated Cmdlet Help

This page has been generated from the HaloAPI PowerShell module source. To make changes please edit the appropriate PowerShell source file.

SYNOPSIS

Sends a request to the Halo API.

SYNTAX

WebRequestParams

Invoke-HaloRequest -WebRequestParams <Hashtable> [-ExpandProperty <String>] [-RawResult]
[-ProgressAction <ActionPreference>] [<CommonParameters>]

RequestParameters

Invoke-HaloRequest -Method <String> [-Uri <String>] [-Fragment <String>] [-Headers <Hashtable>]
[-Body <Object>] [-ContentType <String>] [-ExpandProperty <String>] [-RawResult]
[-ProgressAction <ActionPreference>] [<CommonParameters>]

DESCRIPTION

Wrapper function to send web requests to the Halo API.

Supports the legacy hashtable request format used internally by the module, as well as a direct parameter set for clearer public use.

When using -Fragment, slashless values are treated as Halo API fragments and are automatically prefixed with /api/.

EXAMPLES

EXAMPLE 1

Invoke-HaloRequest -WebRequestParams @{ Method = 'GET'; Uri = 'https://example.halo/api/customtable' }

Uses the legacy request hashtable.

EXAMPLE 2

Invoke-HaloRequest -Method 'POST' -Uri 'https://example.halo/api/customtable' -Body $Payload

Uses the direct parameter set for a POST request with an explicit absolute URI.

EXAMPLE 3

Invoke-HaloRequest -Method 'GET' -Fragment 'tickets'

Resolves a slashless fragment to /api/tickets before sending the request.

EXAMPLE 4

Invoke-HaloRequest -Method 'GET' -Fragment 'tickets' -ExpandProperty 'tickets'

Returns only the tickets property from the JSON response.

PARAMETERS

-WebRequestParams

Hashtable containing the web request parameters.

Type: Hashtable
Parameter Sets: WebRequestParams
Aliases:

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

-Method

HTTP method for the request.

Type: String
Parameter Sets: RequestParameters
Aliases:

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

-Uri

Absolute URI for the request.

Type: String
Parameter Sets: RequestParameters
Aliases:

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

-Fragment

Fragment path to resolve against the Halo base URL. Slashless fragments are automatically prefixed with /api/.

Type: String
Parameter Sets: RequestParameters
Aliases:

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

-Headers

Request headers to merge with the Halo auth headers.

Type: Hashtable
Parameter Sets: RequestParameters
Aliases:

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

-Body

Request body.

Type: Object
Parameter Sets: RequestParameters
Aliases:

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

-ContentType

Content type for the request.

Type: String
Parameter Sets: RequestParameters
Aliases:

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

-ExpandProperty

Returns the value of a property from the JSON response, such as tickets.

Type: String
Parameter Sets: (All)
Aliases:

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

-RawResult

Returns the raw web response. Useful for file downloads.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
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

OUTPUTS

Outputs an object containing the response from the web request.

NOTES