Partager via


Command Constructors

Definition

Overloads

Command(String)

Initializes a new instance of Command class using specified command parameter.

Command(String, Boolean)

Initializes a new instance of Command class using specified command parameter.

Command(String, Boolean, Boolean)

Constructor.

Command(String)

Initializes a new instance of Command class using specified command parameter.

public:
 Command(System::String ^ command);
public:
 Command(Platform::String ^ command);
 Command(std::wstring const & command);
public Command (string command);
new System.Management.Automation.Runspaces.Command : string -> System.Management.Automation.Runspaces.Command
Public Sub New (command As String)

Parameters

command
String

Name of the command or script contents.

Exceptions

Command is null.

Applies to

Command(String, Boolean)

Initializes a new instance of Command class using specified command parameter.

public:
 Command(System::String ^ command, bool isScript);
public:
 Command(Platform::String ^ command, bool isScript);
 Command(std::wstring const & command, bool isScript);
public Command (string command, bool isScript);
new System.Management.Automation.Runspaces.Command : string * bool -> System.Management.Automation.Runspaces.Command
Public Sub New (command As String, isScript As Boolean)

Parameters

command
String

The command name or script contents.

isScript
Boolean

True if this command represents a script, otherwise; false.

Exceptions

Command is null.

Applies to

Command(String, Boolean, Boolean)

Constructor.

public:
 Command(System::String ^ command, bool isScript, bool useLocalScope);
public:
 Command(Platform::String ^ command, bool isScript, bool useLocalScope);
 Command(std::wstring const & command, bool isScript, bool useLocalScope);
public Command (string command, bool isScript, bool useLocalScope);
new System.Management.Automation.Runspaces.Command : string * bool * bool -> System.Management.Automation.Runspaces.Command
Public Sub New (command As String, isScript As Boolean, useLocalScope As Boolean)

Parameters

command
String

The command name or script contents.

isScript
Boolean

True if this command represents a script, otherwise; false.

useLocalScope
Boolean

If true local scope is used to run the script command.

Exceptions

Command is null.

Applies to