JSON Error with Rest API

Hey, I wrote a PowerShell script that will copy deployment processes from one project to another using the RestAPI. It was working perfectly until we added a new step template and now I get this error:

“ErrorMessage”: “After parsing a value an unexpected character was encountered: L. Path ‘Steps[5].Actions[0].Properties.Octopus.Action.Script.ScriptBody’, line 1, position 25928.”,

I know I must have an illegal character somewhere in the script body but I just can’t figure out where. I’ve attached the request and response. Any help would be much appreciated. Thanks!

Request.txt (39 KB)

Response.txt (7 KB)

Hi Matt,

Thanks for reaching out. Could you share me the entire Powershell script for review? Its the only why i’d be able to see what is going on.

Thanks!

Dalmiro

Thanks Dalmario, We were actually able to figure it out, the quotes in the step template were not generic standard quotes, once I fixed that it started working. Thanks!

Glad to hear.

Cheers!