Online Help | Desktop App

Using PowerShell in workflow

Updated in 2023.2

The Alloy workflow engine integrates with PowerShell, a command-line shell and scripting language for automation tasks. This integration enables the direct execution of PowerShell scripts and commands within workflow actions and triggers, as well as the processing of script results within the workflow's programming logic. This page describes the execution environment of your PowerShell commands and scripts when used within the workflow.

There are three areas where PowerShell can be used in Alloy workflow:

  • External Command operations on the client
  • External Command operations on the server
  • PowerShell expressions

The execution context of PowerShell code varies depending on the initiator of the workflow item and its location within the workflow structure. This necessitates the availability of specific programs, modules, and libraries utilized by these PowerShell scripts. Refer to the table below to understand these distinctions.

Initiator External command on client External command on server PowerShell expression
Automation Server

Not supported

Automation Server host

Automation Server host

An Alloy Navigator service installed locally

Not supported

Automation Server host

Computer hosting the service
Alloy Navigator Web App User’s computer running the web browser

Automation Server host

IIS server hosting the Web App

Self Service Portal User’s computer running the web browser Automation Server host

IIS server hosting the Self Service Portal

API Not supported Automation Server host IIS server hosting the API module
Desktop App (being deprecated) User's computer running the Desktop App Automation Server host User's computer running the Desktop App

Additional details:

  • Error 1: When the Automation Server attempts to trigger an External Command operation configured to run on the client, a corresponding error appears in the Workflow Log

  • Alloy Navigator services: Active Directory Import tool (ImportContacts), Alloy Discovery Connector, AlloyScan Connector, Mail Connector, Scheduled Task agent, and Reporting module (ReportCmd)

  • Error 2: When a locally installed Alloy Navigator service attempts to trigger an External Command operation configured to run on the client, a corresponding error appears in the Workflow Log and the service's log

  • Error 3: When the API attempts to trigger an External Command operation configured to run on the client, the API returns the PowerShell code source