CommandParameterAst Class

 

Updated: April 27, 2016

Applies To: Windows PowerShell

The ast that represents a parameter to a command, e.g. dir -Path a*, this class represent '-Path', and in dir -Path:a*, this class represents '-Path:a*'.

In the first case, the argument 'a*' is not represented by this class because the parser can't know until runtime if the argument is positional or if -Path accepts an argument. In the latter case, the argument 'a*' always belongs to the parameter -Path. Introduced in Windows PowerShell 3.0.

Namespace:   System.Management.Automation.Language
Assembly:  System.Management.Automation (in System.Management.Automation.dll)

System.Object
  System.Management.Automation.Language.Ast
    System.Management.Automation.Language.CommandElementAst
      System.Management.Automation.Language.CommandParameterAst

public class CommandParameterAst : CommandElementAst

NameDescription
System_CAPS_pubmethodCommandParameterAst(IScriptExtent, String, ExpressionAst, IScriptExtent)

Constructs a command parameter. Introduced in Windows PowerShell 3.0.

NameDescription
System_CAPS_pubpropertyArgument

The ast for the argument if specified (e.g. -Path:-abc, then the argument is the ast for '-ast'), otherwise null if no argument was specified. Introduced in Windows PowerShell 3.0.

System_CAPS_pubpropertyErrorPosition

The error position to use when parameter binding fails. This extent does not include the argument if one was specified, which means this extent is often the same as Extent. Introduced in Windows PowerShell 3.0.

System_CAPS_pubpropertyExtent

Gets the extent in the source that this abstract syntax tree represents. Introduced in Windows PowerShell 3.0.(Inherited from Ast.)

System_CAPS_pubpropertyParameterName

The name of the parameter. This value does not include a leading dash, and in the case that an argument is specified, no trailing colon is included either. This property is never null or empty. Introduced in Windows PowerShell 3.0.

System_CAPS_pubpropertyParent

Gets the parent tree for this node. Introduced in Windows PowerShell 3.0.(Inherited from Ast.)

NameDescription
System_CAPS_pubmethodCopy()

Copies the CommandParameterAst instance.(Overrides Ast.Copy().)

System_CAPS_pubmethodEquals(Object)

(Inherited from Object.)

System_CAPS_protmethodFinalize()

(Inherited from Object.)

System_CAPS_pubmethodFind(Func<Ast, Boolean>, Boolean)

Retrieves the first node in the abstract syntax tree that matches the search predicate. Introduced in Windows PowerShell 3.0.(Inherited from Ast.)

System_CAPS_pubmethodFindAll(Func<Ast, Boolean>, Boolean)

Retrieves all nodes in the abstract syntax tree that match the search predicate. Introduced in Windows PowerShell 3.0.(Inherited from Ast.)

System_CAPS_pubmethodGetHashCode()

(Inherited from Object.)

System_CAPS_pubmethodGetType()

(Inherited from Object.)

System_CAPS_protmethodMemberwiseClone()

(Inherited from Object.)

System_CAPS_pubmethodSafeGetValue()

Constructs the resultant object from the AST and returns it if it is safe. (Inherited from Ast.)

System_CAPS_pubmethodToString()

Formats an abstract syntax tree and returns a string. Introduced in Windows PowerShell 3.0.(Inherited from Ast.)

System_CAPS_pubmethodVisit(AstVisitor)

Visits each node in an abstract syntax tree, calling the methods in the visitor for each node in the abstract syntax tree. Introduced in Windows PowerShell 3.0.(Inherited from Ast.)

System_CAPS_pubmethodVisit(ICustomAstVisitor)

Visits an abstract syntax tree using a visitor that can choose how the tree traversal is performed. Introduced in Windows PowerShell 3.0.(Inherited from Ast.)

Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show: