search cancel

Powershell job fails after upgrade | the -File parameter does not exist

book

Article ID: 229386

calendar_today

Updated On:

Products

CA Automic Operations Manager

Issue/Introduction

After upgrading or installing the Windows agent, Windows jobs running Powershell interpreter commands fail with an error like the following:

The argument 'JAAAAAAA.TXT.ps1' to the -File parameter does not exist. Provide the path to an existing '.ps1' file as an argument to the -File parameter.

 

Cause

The error message: 

The argument 'JAAAAAAA.TXT.ps1' to the -File parameter does not exist. Provide the path to an existing '.ps1' file as an argument to the -File parameter.

is being reported by powershell and is stating that there's a problem with the full path to the .ps1 file that's being run due to either a missing or incorrect section in the agent ini file

Environment

Release : 12.3

Component : AUTOMATION ENGINE

Resolution

This specific error is caused by an incorrect UC_EX_PATH_TEMP setting.  By default, this looks like:

UC_EX_PATH_TEMP=..\temp

if it is commented out or points to an incorrect path, PS jobs will not work.  

There have also been instances where looking at the ini file, there was no [VARIABLES] section defined.  The section for 12.3 is below:

[VARIABLES]

; UC_EX_JOB_MD: Path and file name of the Job Messenger
;
UC_EX_JOB_MD=.\UCXJWX6M.EXE

; UC_EX_PATH_BACKUP: Path to the backup directory for file backup/restore feature
;
UC_EX_PATH_BACKUP=..\backup\

; UC_EX_PATH_BIN: Path to Agent binaries
;
UC_EX_PATH_BIN=.

; UC_EX_PATH_JOBREPORT: Path to which the Agent writes job reports
;
UC_EX_PATH_JOBREPORT=..\temp

; UC_EX_PATH_TEMP: Path to which the Agent writes log and trace files
;
UC_EX_PATH_TEMP=..\temp

; UC_HOST_CODE: Name of the code table object in client zero used for transporting jobs and job reports to the target system and vice versa
;
UC_HOST_CODE=UC_CODE

; UC_HOST_JCL_VAR: The reference to Includes that are used when the job is generated. (JCL Variant) 
; These are generally the Includes HEADER.*, TRAILER.* and RESTART.* of the system client 0000. User-defined Includes can also be used.
;
UC_HOST_JCL_VAR=WINDOWS

This section should also be in the .ini file that is shipped with the agent installation files.