Open JustinGrote opened 5 days ago
please see spec of this API: https://github.com/Azure/azure-rest-api-specs/blob/main/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/virtualMachine.json#L1152-L1165
expand is a query parameter not payload
@VeryEarly show me how I do this with Invoke-Restmethod syntax without using URI then. That's my point. Whether it's done in -Payload
or as a new parameter, I don't care.
Description
Using
Invoke-AzRestMethod
with GET and payload completely ignores it. It should take the hashtable payload and append it as query parameters, in the same wayInvoke-Restmethod
does with-Body
.In the below script, the payload parameters are not appended as query parameters, they are just ignored. Therefore the query below there is no way to do without doing the -Uri method.
RequestURI generated for the below is
https://management.azure.com/subscriptions/52487fb1-7325-4ec9-9bb0-a9079e62d255/resourceGroups/PRTGDocker/providers/Microsoft.Compute/virtualMachines?api-version=2024-03-01
which is missing the expand query parameter.Issue script & Debug output
Environment data
Module versions
Error output