Powershell activity.output empty when running from script.

thomduran
Kilo Explorer

I am attempting to run a Powershell script and push stdout to activity.output.   I have verified when writing the script that it writes to stdout, but when I run the script from a workflow activity.output returns blank.   If I copy this script in as a command in the Run Powershell activity it works just fine.   Any ideas on why the script itself wouldn't be pushing to stdout although I see it that way when running it manually on the server?   When running from a script does it store output to a different variable?   Or is there something I need to do in my script for SNOW to see the output?

Thanks in advance.  

17 REPLIES 17

Yes we are on Fuji.   Saw that we are able to do that.   Will play with that as well so that I don't have to write the JSON.parser once we get the return.  


Community Alums
Not applicable

Another quick thought here: what does your JSON look like to configure your PowerShell variables that you pass to the script file? Perhaps there is an issue in there? I would expect that to pop an error in a different way, but maybe it is something subtle...


We don't pass any variables to the script file at the moment.   The script that I provided I just removed PASS and USER, but they are statically set at the moment.   Not getting any errors from the workflow itself.  


Did you pull the MIDServer Agent log?   Was there anything there that might have indicated a failure?   Usually if it works locally on the MIDServer box, but does not work via MIDServer script there is a permissions issue, and it sometimes does not manifest in the return, but might (not always) be indicated in the Agent log.   I have bumped into this before.   BTW, the usual test of an AD Query is insufficient to prove that the creds work for execute of commands.


I will double check that there are no additional errors in the MIDServer Agent log.   There wasn't anything when I checked that previously.   It's odd that it would be perms though if the command interface works, but the script does not.   The code itself is just using powershell in order to write to a rest API so would expect that auth issues more on the user we are specifying in the code.