"Unexpected token '&01' in expression or statement." via Powershell script in a Windows Interpeter
search cancel

"Unexpected token '&01' in expression or statement." via Powershell script in a Windows Interpeter

book

Article ID: 90534

calendar_today

Updated On:

Products

CA Automic Workload Automation - Automation Engine

Issue/Introduction

"Unexpected token '&01' in expression or statement." via Powershell script in a Windows Interpeter

Environment

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

Resolution

Symptoms

When attempting to run a job that uses Powershell and a Windows Interpeter your job fails and the report results appear similar to:

Unexpected token 'Default' in expression or statement.
At C:\UC4WA9\Agents\VWASUP03_WIN_POWERSHELL\TEMP\JAADJTVB.TXT.PS1:2 char:11
+ '  Default <<<<  value used -> '&PASSED#'='C:\WINDOWS'.
    + CategoryInfo          : ParserError: (Default:String) [], ParseException
    + FullyQualifiedErrorId : UnexpectedToken


Cause

The Windows Header information is being used when a :READ statement is ran. Powershell attempts to interpret this directly which causes the 'Default' line to be entered and subsequently throw the error.


Resolution

Use the "I" parameter for Input Handling in your :READ statements to suppress documentation generation:

:READ <Variable>,,,,"I"

More information can be found in the documentation under Automic Script Guide --> Ordered by Function --> Activate Objects --> :READ