What is the expected output from the XYZ.ps1 file look like?
Does it execute fine via PS console?
Output of the script is normal Human readable information of a server.
Yes i am able to execute that script via PS console manually and then it gives correct output.
And i got this error when we execute any powershell script locally without using Xcmd feature of powershell adapter but normal powershell command execution is successful.
This is an old thread, but we recently started using Powershell and I am seeing this same error. We are running a very trivial script that has no embedded ampersands at all. The output that is generated from the script however does include ampersands, and I am wondering if this is somehow screwing up the adapter? We are using the 20.12.02.00 module/adapter content.
It appears that this seemingly unrelated error is caused by including the ".ps1" extension on the script command. If you omit the script's extension (even though it actually has this extension on the file system), this error seems to go away. So in your case the command would be:
"./XYZ" instead of "./XYZ.ps1"