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.

:READ statement in script or prescript tab of JOBS with powershellscript runs into error


Article ID: 88482


Updated On:


CA Automic Workload Automation - Automation Engine


:READ statement in script or prescript tab of JOBS with powershellscript runs into error


Release: AOATAM99000-9.0-Automic-One Automation Tools-Application Manager




The issue occurs on jobs with powershell activated when they have a :READ statement in script or prescript, which passes its values to the Shellscript

Error occurs as follows:

Unexpected token 'Input' in expression or statement.
At agentpath\reportfile.ps1:2 char:9
+ ' Input <<<< '0001' used from input buffer -> '&JobNameParam#'='JOBNAME'.
+ CategoryInfo : ParserError: (Input:String) [], ParseException
+ FullyQualifiedErrorId : UnexpectedToken

Job fails then with Ended abnormally.






This is caused because the Interpreter for powershellscripts sees the Interpreter for Automic readcommands as script and runs in error then.




There are basicly two ways to solve the issue one in the Jobobject itself (NOTE only possible if used in JOBS object) and the second one by changing the HEADER.WINDOWS Object in Client 0:

1.) Solution in JOBS object:

adding the parameter "I" to the :READ function;

"I" (only for Jobs)
:READ statements and user inputs are generally documented in the generated Job object in the form of REMARK lines. By specifying the option "I",
this documentation will be suppressed.

-please find further information in Automic script manual, searching for :READ command

2.) preparing the HEADER.WINDOWS Object in client 0 for the usage of :READ command on powershell scripts


 :   set &UC_REM_PRF = 'REM '
 :   set &UC_REM_PRF = "# "