Hello guys I need your help:
I would like to pass a variable in the $body of my command :
$name = "test.com." $headers = @{"X-API-Key" = 'myApiKey' } $body = '{"rrsets": [ {"name": '+ $name +', "type": "CNAME", "ttl": 600, "changetype": "REPLACE", "records": [ {"content": "things.com.", "disabled": false } ] } ] }' Invoke-RestMethod -Method Patch -Uri https://dnsadmin.ovea.com/api.com -Headers $headers -ContentType "application/json" -Body $body
As you can see I try to add the $name variable but it's obviously not the good method, I don't find the correct way to do it.
Does someone have a solution for me ?
Thanks for your time.