Is anyone using PowerShell forInterpreter jobs on Windows? We are experimenting with this, but have not found a completely workable configuration. The sticking point right now is error & return code handling.
The TRAILER.WINDOWS JOBI (include) in client 0 has a bunch of commands that are specific to Windows jobs of type BAT. These include commands to run the job messenger daemon. E.g.,
:INC TRAILER.WINDOWS.USER.END ,nofound=ignoreMy understanding is that these job messenger commands are important for sending information about the status of the job back to the agent and the Automation Engine. There are other similar :IF clauses later in the same JOBI, and in HEADER.WINDOWS too (and this header JOBI is incidentally where several important JDM script variables are set). The default JOBI objects for Windows jobs do not include equivalent commands for PowerShell, or indeed for any jobs of type Interpreter. I gather that this is part of the problem.
:IF &UC_WIN_TYP = "BAT"
&UC_JOBMD JNR=&UC_REALNR MNR=&UC_MANDANT PNR=&UC_IP_PORT IPA=&UC_IP_ADR TYP=E RET=00000000 TXT=" Job ended"
:DATA @set retcodemsg=%errorlevel%
:DATA @set retcode=0
I began working on a solution based on inserting similar commands in TRAILER.WINDOWS.USER.END>
:IF &ATT_WIN_TYP = "EXTCOMPROC"Before I spend too much time on this, I thought I would ask the experts. Has anyone devised a good way to use PowerShell for interpreter jobs?
! Return code handling for PowerShell systems
: PRINT "*** Including PowerShell-specific instructions from TRAILER.WINDOWS.USER.END ***"
! insert return code handling and JMD commands here