PSActivity PSActivity PSActivity Class


Base class for PowerShell-based workflow activities

public abstract class PSActivity : Microsoft.PowerShell.Activities.PipelineEnabledActivity
type PSActivity = class
    inherit PipelineEnabledActivity
Public MustInherit Class PSActivity
Inherits PipelineEnabledActivity


PSActivity() PSActivity() PSActivity()

Constructor for the PSActivity class.


PSBookmarkPrefix PSBookmarkPrefix PSBookmarkPrefix

The bookmark prefix for Powershell activities.

PSPersistBookmarkPrefix PSPersistBookmarkPrefix PSPersistBookmarkPrefix

The bookmark prefix for Powershell persist activities.

PSSuspendBookmarkPrefix PSSuspendBookmarkPrefix PSSuspendBookmarkPrefix

The bookmark prefix for Powershell suspend activities.


AppendOutput AppendOutput AppendOutput Inherited from PipelineEnabledActivity
CanInduceIdle CanInduceIdle CanInduceIdle

In order for an activity to go idle, 'CanInduceIdle' should be true.

Debug Debug Debug

Determines whether to emit debug output of the activity.

DefiningModule DefiningModule DefiningModule

If an activity needs to load a module before it can execute, override this member to return the name of that module.

ErrorAction ErrorAction ErrorAction

Determines how errors should be handled by the activity.

InformationAction InformationAction InformationAction
Input Input Input Inherited from PipelineEnabledActivity
MergeErrorToOutput MergeErrorToOutput MergeErrorToOutput

Determines whether to merge error data to the output stream

PSActionRetryCount PSActionRetryCount PSActionRetryCount

Defines the number of retries that the activity will make when it encounters an error during execution of its action. The default is to not retry.

PSActionRetryIntervalSec PSActionRetryIntervalSec PSActionRetryIntervalSec

Defines the delay, in seconds, between action retry attempts. The default is one second.

PSActionRunningTimeoutSec PSActionRunningTimeoutSec PSActionRunningTimeoutSec

Defines the maximum amount of time, in seconds, that this activity may run. The default is unlimited.

PSCommandName PSCommandName PSCommandName

Gets the fully qualified name of the command invoked by this activity.

PSDebug PSDebug PSDebug

The Debug stream / collection for the activity.

PSDefiningModule PSDefiningModule PSDefiningModule

Returns the module defining the command called by this activity. It may be null.

PSDisableSerialization PSDisableSerialization PSDisableSerialization

Forces the activity to return non-serialized objects. Resulting objects have functional methods and properties (as opposed to serialized versions of them), but will not survive persistence when the Workflow crashes or is persisted.

PSError PSError PSError

The Error stream / collection for the activity.

PSInformation PSInformation PSInformation
PSPersist PSPersist PSPersist

Forces the activity to not call the persist functionality, which will be responsible for persisting the workflow state onto the disk.

PSProgress PSProgress PSProgress

The Progress stream / collection for the activity.

PSProgressMessage PSProgressMessage PSProgressMessage

In addition to the display name PSProgress Message will provide the way to append the additional information into the activity progress message like branch name or iteration number in case of parallel foreach.

PSRequiredModules PSRequiredModules PSRequiredModules

This the list of module names (or paths) that are required to run this Activity successfully. The default is null.

PSVerbose PSVerbose PSVerbose

The Verbose stream / collection for the activity.

PSWarning PSWarning PSWarning

The Warning stream / collection for the activity.

ParameterDefaults ParameterDefaults ParameterDefaults

Provides access to the parameter defaults dictionary

Result Result Result Inherited from PipelineEnabledActivity
Tracer Tracer Tracer

Tracer initialization.

UpdatePreferenceVariable UpdatePreferenceVariable UpdatePreferenceVariable

Indicates if preference variables need to be updated

UseDefaultInput UseDefaultInput UseDefaultInput Inherited from PipelineEnabledActivity
Verbose Verbose Verbose

Determines whether to emit verbose output of the activity.

WarningAction WarningAction WarningAction

Determines how warnings should be handled by the activity.


ActivityEndPersistence(NativeActivityContext) ActivityEndPersistence(NativeActivityContext) ActivityEndPersistence(NativeActivityContext)

The method is override-able by the drived classes in case they would like to implement different logic at the end of persistence. The default behavior would be to schedule the 'Persist' activity if the PSPersist flag is true or Host is asking for it.

CacheMetadata(NativeActivityMetadata) CacheMetadata(NativeActivityMetadata) CacheMetadata(NativeActivityMetadata)

Retrieves the stream and ubiquitous parameter information from the hosting application. These must be passed in as "Streams" and "UbiquitousParameters", respectively.

Cancel(NativeActivityContext) Cancel(NativeActivityContext) Cancel(NativeActivityContext)

Cancel the running activity

Execute(NativeActivityContext) Execute(NativeActivityContext) Execute(NativeActivityContext)

Begins the execution of the activity.

GetActivityArguments() GetActivityArguments() GetActivityArguments()

Retrievs all of the default arguments from the type and its parents.

GetImplementation(NativeActivityContext) GetImplementation(NativeActivityContext) GetImplementation(NativeActivityContext)

Overload this method to implement any command-type specific preparations. If this command needs any workflow-specific information during its PrepareSession call, it should be stored in ActivityImplementationContext.WorkflowContext.

GetPowerShell(NativeActivityContext) GetPowerShell(NativeActivityContext) GetPowerShell(NativeActivityContext)

The method for derived activities to return a configured instance of System.Management.Automation.PowerShell. The implementor should have added all of the commands and parameters required to launch their command through the standard AddCommand() and AddParameter() methods. Derived activites should not manage the Runspace property directly, as the PSActivity class configures the runspace afterward to enable remote connections.

GetRunInProc(ActivityContext) GetRunInProc(ActivityContext) GetRunInProc(ActivityContext)

Determine if this activity should be run in or out of process when run locally/

PrepareSession(ActivityImplementationContext) PrepareSession(ActivityImplementationContext) PrepareSession(ActivityImplementationContext)

The method for derived activities to customize the runspace of a System.Management.Automation.PowerShell instance that the runtime has prepared for them. If the command needs any workflow-specific information during this PrepareSession call, it should be stored in ActivityImplementationContext.WorkflowContext during the GetCommand preparation phase.

UpdateImplementationContextForLocalExecution(ActivityImplementationContext, ActivityContext) UpdateImplementationContextForLocalExecution(ActivityImplementationContext, ActivityContext) UpdateImplementationContextForLocalExecution(ActivityImplementationContext, ActivityContext)

Updates the ImplementationContext returned from GetPowerShell() to support local execution against the host's runspace pool.

WriteProgressRecord(NativeActivityContext, PSDataCollection<ProgressRecord>, String, ProgressRecordType) WriteProgressRecord(NativeActivityContext, PSDataCollection<ProgressRecord>, String, ProgressRecordType) WriteProgressRecord(NativeActivityContext, PSDataCollection<ProgressRecord>, String, ProgressRecordType)

Write a progress record fo the current activity

Applies to