Skip to content

Invoke-vRARestMethod

SYNOPSIS

Wrapper for Invoke-RestMethod/Invoke-WebRequest with vRA specifics

SYNTAX

Standard (Default)

Invoke-vRARestMethod -Method <String> -URI <String> [-Headers <IDictionary>] [-WebRequest] [<CommonParameters>]

OutFile

Invoke-vRARestMethod -Method <String> -URI <String> [-Headers <IDictionary>] [-OutFile <String>] [-WebRequest]
 [<CommonParameters>]

Body

Invoke-vRARestMethod -Method <String> -URI <String> [-Headers <IDictionary>] [-Body <String>] [-WebRequest]
 [<CommonParameters>]

DESCRIPTION

Wrapper for Invoke-RestMethod/Invoke-WebRequest with vRA specifics

EXAMPLES

EXAMPLE 1

Invoke-vRARestMethod -Method GET -URI '/iaas/api/about'

EXAMPLE 2

$JSON = @"
    {
        "name": "TestOnboardingPlan",
        "endpointId": "42fe38765a63bd755921a88814a14",
        "projectId": "9f732951-2279-422a-8045-9b254d427100"
    }
"@

Invoke-vRARestMethod -Method POST -URI '/relocation/onboarding/plan' -Body $JSON -WebRequest

PARAMETERS

-Method

REST Method: Supported Methods: GET, PATCH, POST, PUT, DELETE

Type: String
Parameter Sets: (All)
Aliases:

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

-URI

API URI, e.g. /identity/api/tenants

Type: String
Parameter Sets: (All)
Aliases:

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

-Headers

Optionally supply custom headers

Type: IDictionary
Parameter Sets: (All)
Aliases:

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

-Body

REST Body in JSON format

Type: String
Parameter Sets: Body
Aliases:

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

-OutFile

Save the results to a file

Type: String
Parameter Sets: OutFile
Aliases:

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

-WebRequest

Use Invoke-WebRequest rather than the default Invoke-RestMethod

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

System.String

Switch

OUTPUTS

System.Management.Automation.PSObject

NOTES