I'm trying to pass a json script to curl using powershell. It seems to work if I hard code it right into a variable escaping the double quotes with backslash, but I want to pass the json in a file. I tried putting the json script in a separate json file and then use get-content and throw it in a variable, but it does not seem to work I get a "Validation_Error". Any suggestions
This Works
But I want to do something like this
$json = Get-Content C:\test.json
curl -v -X POST https://api.paypal.com/v1/invoicing/invoices/ \ -H "Content-Type:application/json" \ -H "Authorization: Bearer $token" \ -d $json

Get-Content C:\test.json -Rawwork? That loads the content into a single string instead of an array with one string per line.