When attempting to run a job on Windows agent that executes a PowerShell script, the job goes to RUNNING status and the script is not executed. The job stays in RUNNING status until it is issued a KILLJOB event.
The job command is specified in the format...
The WA Agent on Windows executes commands through the Windows command-line interpreter (cmd.exe). When executing a PowerShell script from the Windows command-line interpreter, you must run it using the 'powershell -file <script_name>' command. Otherwise, the script is just opened in the default text editor associated with .ps1 files on the Windows machine. This is why the job will stay in the RUNNING status and not actually execute the script. When the job is launched, the script is opened into a text editor in the background on the Windows agent machine and does not actually execute. It also does not exit.
Modify the job's command attribute so that the script is executed through PowerShell.
command: powershell -file c\:\test\ps_script.ps1