CommandAst Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
The ast for a command invocation, e.g. dir *.ps1
.
public ref class CommandAst : System::Management::Automation::Language::CommandBaseAst
public class CommandAst : System.Management.Automation.Language.CommandBaseAst
type CommandAst = class
inherit CommandBaseAst
Public Class CommandAst
Inherits CommandBaseAst
- Inheritance
Constructors
CommandAst(IScriptExtent, IEnumerable<CommandElementAst>, TokenKind, IEnumerable<RedirectionAst>) |
Construct a command invocation. |
Properties
CommandElements |
A non-empty collection of command elements. This property is never null. |
DefiningKeyword |
If this command was synthesized out of a dynamic keyword, this property will point to the DynamicKeyword data structure that was used to create this command. |
Extent |
The extent in the source this ast represents. (Inherited from Ast) |
InvocationOperator |
The invocation operator (either Dot or Ampersand) if one was specified, otherwise the value is Unknown. |
Parent |
The parent tree for this node. (Inherited from Ast) |
Redirections |
The possibly empty collection of redirections for this command. (Inherited from CommandBaseAst) |
Methods
Copy() |
Copy the CommandAst instance. |
Find(Func<Ast,Boolean>, Boolean) |
Traverse the entire Ast, returning the first node in the tree for which |
FindAll(Func<Ast,Boolean>, Boolean) |
Traverse the entire Ast, returning all nodes in the tree for which |
GetCommandName() |
Returns the name of the command invoked by this ast. This command name may not be known statically, in which case null is returned.
For example, if the command name is in a variable: |
SafeGetValue() |
Constructs the resultant object from the AST and returns it if it is safe. (Inherited from Ast) |
SafeGetValue(Boolean) |
Constructs the resultant object from the AST and returns it if it is safe. (Inherited from Ast) |
ToString() |
Formats the ast and returns a string. (Inherited from Ast) |
Visit(AstVisitor) |
Visit each node in the Ast, calling the methods in |
Visit(ICustomAstVisitor) |
Visit the Ast using a visitor that can choose how the tree traversal is performed. This visit method is for advanced uses of the visitor pattern where an AstVisitor is insufficient. (Inherited from Ast) |