I have a param section of a Invoke-RestMethod that i have to keep as is, but also add parameters:
$param = @{
...
Body = '{"entry":[{"@name":SOMETEXT,"static":{"member":[ANOTHERTEXT]}}]}'
...
}
Since the entire Body
is in single quotes, any $parameter
added will be treated like a string instead of a normal PowerShell parameter
In this case SOMETEXT
and ANOTHERTEXT
will be $HubAddressObject
and $ArrayList
, respectivly.
How do i make that Body entry work with parameters, and keeping the same structure (this is part of a Panorama box)?
What i would need would be:
Body = '{"entry":[{"@name":$HubAddressObject,"static":{"member":[$ArrayList]}}]}'
Thanks.