Partager via


PSActivity.GetPowerShell(NativeActivityContext) Method

Definition

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.

protected:
 abstract Microsoft::PowerShell::Activities::ActivityImplementationContext ^ GetPowerShell(System::Activities::NativeActivityContext ^ context);
protected abstract Microsoft.PowerShell.Activities.ActivityImplementationContext GetPowerShell (System.Activities.NativeActivityContext context);
abstract member GetPowerShell : System.Activities.NativeActivityContext -> Microsoft.PowerShell.Activities.ActivityImplementationContext
Protected MustOverride Function GetPowerShell (context As NativeActivityContext) As ActivityImplementationContext

Parameters

context
NativeActivityContext

The NativeActivityContext for the currently running activity.

Returns

A populated instance of Sytem.Management.Automation.PowerShell

Remarks

The infrastructure takes responsibility for closing and disposing the PowerShell instance returned.

Applies to