Jobs containing PowerShell scripts failing with "__call_messanger' is not recognized as the name of a cmdlet"
search cancel

Jobs containing PowerShell scripts failing with "__call_messanger' is not recognized as the name of a cmdlet"

book

Article ID: 270620

calendar_today

Updated On:

Products

CA Automic Workload Automation - Automation Engine

Issue/Introduction

Jobs containing the powershell scripts failing with the below message after upgrading to Automic 21 - 

__call_messanger : The term '__call_messanger' is not recognized as the name of a cmdlet,
function, script file, or operable program. Check the spelling of the name, or if a path was
included, verify that the path is correct and try again.
At D:\Automic\Agents\OS\TEST\temp\JBOWFJFZ.TXT.ps1:35 char:1
+ __call_messanger "E" "0"
+ ~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (__call_messanger:String) [], CommandNotFoundExcept
   ion
    + FullyQualifiedErrorId : CommandNotFoundException

The actual Powershell script has been executed successfully. However the job returned the failure.

Environment

Release : 21.0 and higher

Cause

This is due to the Powershell interpreter header is missing in the HEADER.WINDOWS while external interpreter is defined as powershell in the agent (ECPEXE=)

Resolution

Logon to client 0.

Find the object HEADER.WINDOWS

Uncomment the below INC line : 

! :INC HEADER.WINDOWS.PWSH.HEAD ,nofound=ignore

(Remove the "!" but not the ":")

Save the object.

Rerun the jobs containing powershell scripts.

Additional Information

! Please use the PWSH.HEAD header if the external interpreter in Agent's INI (ECPEXE=) is PowerShell
! The header contains the necessary functions such as __uc_return() to allow proper PowerShell integration with Automic

! :INC HEADER.WINDOWS.PWSH.HEAD ,nofound=ignore

Custom Interpreter:

https://docs.automic.com/documentation/webhelp/english/ALL/components/DOCU/21.0.7/Automic%20Automation%20Guides/Content/AWA/Objects/obj_jobs_WIN.htm?Highlight=ECPEXE%3D