Formatting JSON in Powershell


#1

I’m trying to update contact properties using powershell. I can connect and get the contacts just fine, but when updating, I guess I’m having problems with the JSON.
Here’s a snippet of the code:
$body = @{
property = "hs_lead_status"
value = “Open”
}

$body | ConvertTo-Json;

Invoke-RestMethod -Method Post -Uri “$ContactURL” -Body ($body) -Header @{“X-ApiKey” = $APIKey}

Ok, that’s fairly simple and notice I’m converting my $body variable to json. The json it creates looks like this:
{
“value”: “Open”,
“property”: “hs_lead_status”
}

And I get back this error message:

Invoke-RestMethod : {“status”:"error"strong text,“message”:"Invalid JSON input: Unrecognized token ‘value’: was expecting (‘true’, ‘false’ or ‘null’) at line 1, column
**7",“correlationId”:"d2a5b152-8987-4c64-bf7c-fcf661d41f94",“requestId”:“c11e32e5a33867e417834daf1119fbc5”}
At C:\PS\HubSpotAPI.ps1:57 char:2
+ Invoke-RestMethod -Method Post -Uri “$ContactURL” -Body ($body) - …
**+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~**
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand

Can anyone tell me what’s wrong with the format of this?