For the complete documentation index, see llms.txt. This page is also available as Markdown.

Invoke-PSUWorkflow

Invoke-PSUWorkflow runs a configured PowerShell Universal workflow by name, ID, or workflow object.

SYNOPSIS

Runs a workflow in PowerShell Universal.

SYNTAX

Invoke-PSUWorkflow -Name <String> [-Parameters <Hashtable>] [-Environment <String>] [-Queue <String>] [-Wait] [-WaitTimeout <Int32>] [<ExecutionOptions>] [<ConnectionOptions>]
Invoke-PSUWorkflow -Id <Int64> [-Parameters <Hashtable>] [<ExecutionOptions>] [<ConnectionOptions>]
Invoke-PSUWorkflow -Workflow <Workflow> [-Parameters <Hashtable>] [<ExecutionOptions>] [<ConnectionOptions>]

<ExecutionOptions>: [-WaitForDebugger] [-Environment <String>] [-Notes <String>] [-Credential <Variable>] [-Wait] [-Queue <String>] [-WaitTimeout <Int32>] [-Tags <Tag[]>] [-Silent]. <ConnectionOptions>: [-ComputerName <String>] [-AppToken <String>] [-UseDefaultCredentials] [-Integrated] [-TrustCertificate] [-Cookies] [<CommonParameters>]. Here -Credential is a PSU credential variable for workflow execution, not Management API Basic credentials.

DESCRIPTION

Runs a configured workflow selected by name, ID, or workflow object (accepts pipeline input). Supply declared workflow inputs through -Parameters: unknown names cause an error. Override the execution environment or queue and optionally wait for completion. With -Wait, the cmdlet delegates to Wait-PSUJob; otherwise it returns the created job.

EXAMPLES

Invoke-PSUWorkflow -Name 'DailyMaintenance'
Invoke-PSUWorkflow -Name 'Deploy' -Parameters @{ Environment = 'Test' } -Wait

PARAMETERS

Parameter
Description

-Name

Required workflow name in the default parameter set; case-insensitive.

-Id

Required numeric workflow ID in the Id parameter set.

-Workflow

Workflow object; accepts pipeline input.

-Parameters

Hashtable of declared workflow input values; unknown parameter names fail.

-Environment

Execution environment override (alias -PowerShellVersion).

-Queue

Execution queue or computer group (alias -ComputerGroup).

-Wait

Waits for the workflow job to complete.

-WaitTimeout

Timeout in seconds used when waiting; omitted or zero leaves the wait without this timeout override.

-WaitForDebugger

Waits for debugger attachment before execution.

-Notes

Notes attached to the workflow job.

-Credential

PSU credential variable used for execution.

-Tags

Tags attached to the job.

-Silent

Suppresses output from the wait operation.

-ComputerName

PSU Management API URL or host name (alias -Uri).

-AppToken

Management API app token.

-UseDefaultCredentials

Uses current Windows credentials.

-Integrated

Uses the in-process management client.

-TrustCertificate

Ignores certificate validation errors.

-Cookies

Reuses session authentication cookies.

PERMISSIONS

The access token requires automation.workflows/execute to run this cmdlet remotely. Retrieving a workflow first with Get-PSUWorkflow also requires automation.workflows/read.

Was this helpful?