Symptoms

Either directly or indirectly (through a batch file) your adTempus job runs powershell.exe to execute a PowerShell script. When the task runs, powershell.exe never finishes executing so the step never completes.

Cause

This problem happens if you use the Capture Console window mode (adTempus 3 and earlier) or the Capture screen output from console-mode program option (adTempus 4 and later).

Using the capture console option causes adTempus to redirect the STDIN and STDOUT handles for the program it runs, and this causes PowerShell.exe to hang as described in this problem report.

Workaround

To avoid this problem you can use any of the following approaches:

  • Turn off the console capture option and use another method to capture output. 
  • In adTempus 4 and later, use a Script Execution Task to run your script without calling powershell.exe.
  • Override the redirection of the STDIN handle or run the script without calling powershell.exe, as discussed below.

Override STDIN redirection

Overriding STDIN redirection to point STDIN back to the console (CON) will avoid the problem.

If you are calling PowerShell from a batch file, add "< CON" to the end of the line where powershell.exe is called. For example:

powershell.exe -file ScriptFile.ps < CON

If you are running PowerShell directly from adTempus (i.e., powershell.exe is the Execution Target for your task) you will need to have adTempus run a batch file instead, and have the batch file call PowerShell using the redirection shown above.