title: How to put json script in a file to use in PowerShell using cURL
body: <p>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</p>
  
  <p>This Works</p>
  
  <p><a href="https://i.stack.imgur.com/JEHdc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JEHdc.png" alt="enter image description here"></a></p>
  
  <p>But I want to do something like this</p>
  
  <p>$json = Get-Content C:\test.json</p>
  
  <p>curl -v -X POST <a href="https://api.paypal.com/v1/invoicing/invoices/" rel="nofollow noreferrer">https://api.paypal.com/v1/invoicing/invoices/</a> \ -H "Content-Type:application/json" \ -H "Authorization: Bearer $token" \ -d $json</p>