ALERT: Some images may not load properly within the Knowledge Base Article. If you see a broken image, please right-click and select 'Open image in a new tab'. We apologize for this inconvenience.

When using the REGISTER_VARIABLE with powershell, command will not execute properly

book

Article ID: 88223

calendar_today

Updated On:

Products

CA Automic Workload Automation - Automation Engine

Issue/Introduction

When using the REGISTER_VARIABLE with the powershell, powershell command will not properly execute.

Error:
c:\>C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe C:\AE\Agents\Windows\Resources\0100\0001064286\0001064286_0001.ps1 
Missing expression after ','.
At C:\AE\Agents\Windows\Resources\0100\0001064286\0001064286_0001.ps1:7 char:16
5
+     command = "C:\\AE\\Agents\\Windows\\bin\\UCXJWX6M.EXE JNR=0001064286 MNR=
0100 PNR=2300 IPA=172.18.80.109 TYP=V VTYPE=T NAME=return_code# VALUE=\"%s\" " 
% ($bta, <<<<  )
    + CategoryInfo          : ParserError: (,:String) [], ParseException
    + FullyQualifiedErrorId : MissingExpressionAfterToken

Environment

OS: Windows

Resolution

In UC_EXT_INTERPRETERS_WINDOW script, place a space between the first single quote and the word POWERSHELL to make REGISTER_VARIABLE work.

For example:
if &$EXT_INTERPRETER# = ' POWERSHELL'