search cancel

PowerShell Operator doesn't return any scriptOutput or it doesn't run at all

book

Article ID: 8664

calendar_today

Updated On:

Products

CA Process Automation Base

Issue/Introduction

A PowerShell Operator in Process Automation that should return a value does not work.

The scriptOutput returns blank value.

For example:

In a simple PowerShell:

   write-host "hello world"

The script is executed and completed successfully, but the scriptOutput comes blank instead of "hello world".

It works fine with a .cmd or .bat script, however it does not work while using .ps1 (powershells).

Environment

Process automation 4.3.02 and above

PowerShell 4 or 5

Cause

The "oasis.powershell.setexecutionpolicy" parameter in the "OasisConfig.properties" file is not set to true.

Resolution

Change the parameter that affect the return of the Powershell command output:

Go to "PAM\server\c2o\.config\OasisConfig.properties", then change

from:

oasis.powershell.setexecutionpolicy=false 

to:

oasis.powershell.setexecutionpolicy=true