ActivityGenerator.GenerateFromCommandInfo Method

Definition

Overloads

GenerateFromCommandInfo(CommandInfo, String)

By default, the activity wrapper uses the remoting command base.

GenerateFromCommandInfo(CommandInfo, String, Boolean)

By default, the activity wrapper uses the remoting command base.

GenerateFromCommandInfo(CommandInfo, String, String, String[], String, String)

Generate an activity for the given command.

GenerateFromCommandInfo(CommandInfo, String)

By default, the activity wrapper uses the remoting command base.

public static string GenerateFromCommandInfo (System.Management.Automation.CommandInfo command, string activityNamespace);
Parameters
command
CommandInfo

The command name to generate.

activityNamespace
String

The namespace that will contain the command - for example, Microsoft.PowerShell.Activities.

Returns

GenerateFromCommandInfo(CommandInfo, String, Boolean)

By default, the activity wrapper uses the remoting command base.

public static string GenerateFromCommandInfo (System.Management.Automation.CommandInfo command, string activityNamespace, bool shouldRunLocally);
Parameters
command
CommandInfo

The command name to generate.

activityNamespace
String

The namespace that will contain the command - for example, Microsoft.PowerShell.Activities.

shouldRunLocally
Boolean

True if remoting-related parameters should be suppressed. This should only be specified for commands that offer no value when run on a remote computer.

Returns

GenerateFromCommandInfo(CommandInfo, String, String, String[], String, String)

Generate an activity for the given command.

public static string GenerateFromCommandInfo (System.Management.Automation.CommandInfo command, string activityNamespace, string activityBaseClass, string[] parametersToExclude, string moduleToLoad, string moduleDefinitionText);
Parameters
command
CommandInfo

The command to use as the basis of the generated activity.

activityNamespace
String

The namespace that will contain the command - for example, Microsoft.PowerShell.Activities.

activityBaseClass
String

The class to use as the base class for this activity

parametersToExclude
String[]

A list of parameters on the command being wrapped that should not be copied to the activity.

moduleToLoad
String

The module that contains the wrapped command

moduleDefinitionText
String

Addition text to inset in the class definition

Returns

A string representing the C# source code of the generated activity.