Freigeben über


CommandAst Constructor

Definition

Construct a command invocation.

public:
 CommandAst(System::Management::Automation::Language::IScriptExtent ^ extent, System::Collections::Generic::IEnumerable<System::Management::Automation::Language::CommandElementAst ^> ^ commandElements, System::Management::Automation::Language::TokenKind invocationOperator, System::Collections::Generic::IEnumerable<System::Management::Automation::Language::RedirectionAst ^> ^ redirections);
public CommandAst (System.Management.Automation.Language.IScriptExtent extent, System.Collections.Generic.IEnumerable<System.Management.Automation.Language.CommandElementAst> commandElements, System.Management.Automation.Language.TokenKind invocationOperator, System.Collections.Generic.IEnumerable<System.Management.Automation.Language.RedirectionAst> redirections);
new System.Management.Automation.Language.CommandAst : System.Management.Automation.Language.IScriptExtent * seq<System.Management.Automation.Language.CommandElementAst> * System.Management.Automation.Language.TokenKind * seq<System.Management.Automation.Language.RedirectionAst> -> System.Management.Automation.Language.CommandAst
Public Sub New (extent As IScriptExtent, commandElements As IEnumerable(Of CommandElementAst), invocationOperator As TokenKind, redirections As IEnumerable(Of RedirectionAst))

Parameters

extent
IScriptExtent

The extent of the command, starting with either the optional invocation operator '&' or '.' or the command name and ending with the last command element.

commandElements
IEnumerable<CommandElementAst>

The elements of the command (command name, parameters and expressions.).

invocationOperator
TokenKind

The invocation operator that was used, if any.

redirections
IEnumerable<RedirectionAst>

The redirections for the command, may be null.

Exceptions

If extent is null.

If commandElements is null or is an empty collection.

Applies to