Powershell + Json

I’m trying to use a powershell with the invoke rest-method, and it is working perfectly except BigFix thinks that the file is invalid json syntax. When I copy the file text to any json validator it says that is valid json. Any idea on what is causing this to happen?

Code is as follows:

Invoke-RestMethod ‘XXXXX’ -Method ‘GET’ -Headers $headers -Body $body | ConvertTo-Json -Depth 100 | Out-File “XXXX”

P.

I think you’d need to post the JSON output, and the details of how you’re trying to read it in Bigfix.

Thanks, it’s a powershell problem, as the data comes out formatted in a non-standard way. It also doesn’t help that the BigFix inspector cannot parse a file that is not well structured.

I haven’t had problems with Bigfix inspecting properly-structured JSON, but of course that will be impossible to determine without a working sample and the relevance you are trying to use in parsing it.