This does help a lot... still encountering some issues though... for the Boolean values if I send them as true of false I either get:
Invoke-RestMethod : {"code":400,"message":"Found unexpected json boolean at configuration item /ltm/policy/~Common~Drafts~TEST_POLICY_AUTOMATION/rules/Testing/conditions/equals. The json boolean is
true.","errorStack":[],"apiError":1}
or
Invoke-RestMethod : {"code":400,"message":"Found unexpected json string at configuration item /ltm/policy/~Common~Drafts~TEST_POLICY_AUTOMATION/rules/Testing/conditions/equals. The json string is
\"true\".","errorStack":[],"apiError":1}
This is the JSON I am using in my script, basing it off what you sent as a test
$ActionsBody = [ordered]@{
actions = @{
name = "0"
request = $true
forward = $true
pool = '/Common/pool_test'
}
conditions =@{
name = "0"
request = "true"
httpHost = "true"
equals = "true"
values = "www.mydomain.net"
}
}
Invoke-RestMethod -Uri https://$url/mgmt/tm/ltm/policy/~Common~Drafts~$Policy/rules/Testing -Method PUT -Headers $Header -Body (ConvertTo-Json $ActionsBody) -ContentType 'application/json'