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

New-PSUWorkflowActivity

SYNOPSIS

Creates a workflow activity definition.

SYNTAX

New-PSUWorkflowActivity -Type <String> [-Id <String>] [-Name <String>] [-ScriptFullPath <String>] [-TrueContinueAfterDecision <Boolean>] [-FalseContinueAfterDecision <Boolean>] [-Parameters <Hashtable>] [-Expressions <Hashtable>] [<ConnectionOptions>] [<CommonParameters>]

<ConnectionOptions>: [-ComputerName <String>] [-AppToken <String>] [-Credential <PSCredential>] [-UseDefaultCredentials] [-Integrated] [-TrustCertificate] [-Cookies]. Activity metadata can expose additional dynamic parameters for the chosen -Type.

DESCRIPTION

Builds an activity for the -Definition script block of New-PSUWorkflow. -Parameters supplies literal activity properties and -Expressions supplies PowerShell expressions evaluated at runtime. Container activities, including Sequence and Parallel, support nested activities. The cmdlet looks up activity metadata to validate the type and expose dynamic parameters; if dynamic parameter lookup fails, use -Parameters instead.

EXAMPLE

New-PSUWorkflowActivity -Type Parallel -Activities {
    New-PSUWorkflowActivity -Type Script -ScriptFullPath 'C:\Repository\Test1.ps1'
    New-PSUWorkflowActivity -Type Script -ScriptFullPath 'C:\Repository\Test2.ps1'
}

PARAMETERS

Parameter
Description

-Type

Required registered workflow activity type.

-Id

Activity identifier.

-Name

Activity name.

-ScriptFullPath

Script path for a script-backed activity.

-TrueContinueAfterDecision

Whether the true branch continues after a decision (default $true).

-FalseContinueAfterDecision

Whether the false branch continues after a decision (default $true).

-Parameters

Hashtable of literal activity property values.

-Expressions

Hashtable of runtime PowerShell expressions.

-ComputerName

PSU server URL or host name for metadata lookup (alias -Uri).

-AppToken

Management API app token for metadata lookup.

-Credential

Management API credentials.

-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/read to run this cmdlet remotely. The cmdlet reads activity metadata to build a workflow definition; it does not create a workflow on the server.

Last updated

Was this helpful?