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

New-PSUWorkflowActivity

Creates a workflow activity definition.

SYNOPSIS

Creates a workflow activity definition.

SYNTAX

New-PSUWorkflowActivity [-Type] <String> [-Name <String>] [-ScriptFullPath <String>] [-Parameters <Hashtable>]
 [-Expressions <Hashtable>] [-ComputerName <String>] [-AppToken <String>] [-Credential <PSCredential>]
 [-UseDefaultCredentials] [-Integrated] [-TrustCertificate] [-Cookies]
 [<CommonParameters>]

DESCRIPTION

Builds a workflow activity definition that can be embedded in the -Definition script block of New-PSUWorkflow. The activity type controls which properties are available. For built-in and script-backed activities, the cmdlet can surface dynamic parameters based on the selected -Type and optional -ScriptFullPath. Use -Parameters to pass literal property values and -Expressions to assign PowerShell expressions when a property should be evaluated at runtime instead of serialized as a fixed value.

EXAMPLES

Example 1

PS C:\> New-PSUWorkflowActivity -Type Flowchart

Creates a simple flowchart activity definition that can be used as the root activity of a workflow.

Example 2

Creates a script activity and binds dynamic parameters from the script-backed workflow activity metadata.

Example 3

Creates a container activity and supplies nested activities through the -Parameters hashtable.

PARAMETERS

-AppToken

Specifies the app token to use when authenticating to the PowerShell Universal management API.

-ComputerName

Specifies the URL or host name of the target PowerShell Universal instance. Bare host names are normalized to an http://<host>:5000 URL.

-Cookies

Reuses and persists authentication cookies for the current PowerShell session.

-Credential

Specifies the credentials to use for Basic authentication against the PowerShell Universal management API.

-Expressions

Specifies activity property values as PowerShell expressions. Use this hashtable when the target activity property should execute an expression at runtime instead of storing a serialized literal value.

-Integrated

Uses the in-process integrated management client when the cmdlet runs inside PowerShell Universal.

-Name

Specifies the activity name to assign to the generated workflow activity definition.

-Parameters

Specifies literal activity property values. Each key must match a valid property for the selected activity type.

-ScriptFullPath

Specifies the full path of the script when -Type Script is used. The cmdlet uses this path to resolve script-backed activity metadata and dynamic parameters.

-TrustCertificate

Allows connections to servers with untrusted TLS certificates.

-Type

Specifies the workflow activity type to create, such as Flowchart, Sequence, or Script. The selected type determines which dynamic parameters and properties are available.

-UseDefaultCredentials

Uses the current Windows credentials when authenticating to the management API.

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -Verbose, -WarningAction, -WarningVariable, and -ProgressAction. For more information, see about_CommonParameters.

INPUTS

None

OUTPUTS

PowerShellUniversal.Models.Workflows.WorkflowActivityDefinition

NOTES

New-PSUWorkflow

Last updated

Was this helpful?