In my case, I ´veI´ve replaced all double quotes by single quote before call the parameter, and set double quote just in the beggining and in the end. Worked like a charm in Powershell Script.
In my scenario, I was calling Powershell from groovy.
changeorderParam is where I have my Json string.
changeorderParam = changeorderParam.replaceAll(""", "'") bat "powershell.exe -Executionpolicy bypass -file C:\\scripts\\script.ps1 \"${template}\" \"${script}\" \"${branch}\" \"${changeorderParam}\""
changeorderParam = changeorderParam.replaceAll("\"", "'") bat "powershell.exe -Executionpolicy bypass -file C:\\\scripts\\\script.ps1 \\\"${template}\\\" \\"${script}\\" \\"${branch}\\" \\"${changeorderParam}\\"" I hope this help someone!