Export (0) Print
Expand All
Expand Minimize

System.Management.Automation.Language Namespace

The System.Management.Automation.Language namespace contains classes, interfaces, and enumerations that allow the customization of actions that occur when processing different types of Windows PowerShell language entities.

ClassDescription
ArrayExpressionAstThe ast that represents an array expression, e.g. @(1). The array literal (e.g. 1,2,3) is represented by ArrayLiteralAst.
ArrayLiteralAstThe ast that represents an array literal expression, e.g. 1,2,3. An array expression, e.g. @(dir), is represented by ArrayExpressionAst. An array literal expression can be constructed from a single element, as happens with the unary comma operator, e.g. ,4.
ArrayTypeNameRepresents the name of an array type, including the dimensions.
AssignmentStatementAstThe ast that represents an assignment statement, e.g. $x = 42.
AstRepresents the abstract base class for all PowerShell abstract syntax tree nodes.
AstVisitorRepresents functionality to be invoked on nodes of different types when an abstract syntax tree is traversed by the PowerShell engine.
AttributeAstThe ast representing an attribute with optional positional and named arguments.
AttributeBaseAstAn abstract base class representing attributes that accept optional arguments, e.g. [Parameter()], as well as type constraints, such as [int].
AttributedExpressionAstThe ast that represents an expression with an attribute. This is normally allowed only on parameters or variables being assigned, e.g. [Parameter()]$PassThru or [ValidateScript({$true})$abc = 42.
BinaryExpressionAstThe ast representing a binary expression, e.g. $a + $b.
BlockStatementAstRepresents an abstract syntax tree of a script block with a keyword name.
BreakStatementAstThe ast representing the break statement.
CatchClauseAstThe ast that represents a single catch as part of a try statement.
CommandAstRepresents the abstract syntax tree for a command invocation (for example, dir *.ps1).
CommandBaseAstAn abstract base class for a command and an expression wrapper that allows an expression as a command in a pipeline.
CommandElementAstAn abstract base class for the components of a CommandAst.
CommandExpressionAstThe ast representing an expression when the expression is used as the first command of a pipeline.
CommandParameterAstThe 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.
CommentHelpInfoContains the help content specified in help comments for a given script or script function.
ConstantExpressionAstThe ast representing constant values, such as numbers. Constant values mean truly constant, as in, the value is always the same. Expandable strings with variable references (e.g. "$val") or sub-expressions (e.g. "$(1)") are not considered constant.
ContinueStatementAstThe ast representing the continue statement.
ConvertExpressionAstThe ast that represents a cast expression, e.g. [wmiclass]"Win32_Process".
DataStatementAstThe ast representing the data statement.
DoUntilStatementAstThe ast that represents a do/until statement.
DoWhileStatementAstThe ast that represents the do/while statement.
DynamicKeyword 
DynamicKeywordParameter 
DynamicKeywordProperty 
ErrorExpressionAstA placeholder expression used when there are syntactic errors in the source script.
ErrorStatementAstRepresents a placeholder statement that is used when there are syntactic errors in the source script.
ExitStatementAstThe ast representing the exit statement.
ExpandableStringExpressionAstThe ast that repesents a double quoted string and can have nested variable references or sub-expressions, e.g. "Name: $name`nAge: $([DateTime]::Now.Year - $dob.Year)".
ExpressionAstAn abstract base class that represents all PowerShell expressions.
FileRedirectionAstThe ast representing a redirection to a file, e.g. dir > out.txt, the '> out.txt' is represented by this ast.
FileRedirectionTokenA file redirection.
ForEachStatementAstThe ast representing the foreach statement.
ForStatementAstThe ast for a for statement.
FunctionDefinitionAstThe ast that represents a function or filter definition. The function is always named.
GenericTypeNameRepresents a closed generic type, including its arguments.
HashtableAstThe ast that represents a hash literal, e.g. @{a = 1}.
IfStatementAstThe ast that represents an if statement.
IndexExpressionAstThe ast that represents an index expression, e.g. $a[0].
InputRedirectionTokenThe (currently unimplemented) input redirection.
InvokeMemberExpressionAstThe ast that represents the invocation of a method, e.g. $sb.Append('abc') or [math]::Sign($i).
LabeledStatementAstAn abstract base class for statements that have labels such as a while statement or a switch statement.
LabelTokenRepresents a label token, which begins with a colon (":") and is followed by the label name.
LoopStatementAstAn abstract base class for looping statements including the do/while statement, the do/until statement, the foreach statement, the for statement, and the while statement.
MemberExpressionAstThe ast that represents accessing a member as a property, e.g. $x.Length or [int]::MaxValue. Most often this is a simple property access, but methods can also be access in this manner, returning an object that supports invoking that member.
MergingRedirectionAstThe ast representing a redirection that merges 2 streams, e.g. dir 2>&1
MergingRedirectionTokenA merging redirection.
NamedAttributeArgumentAstThe ast representing a named attribute argument. For example, in [Parameter(Mandatory=$true)], this ast represents Mandatory=$true.
NamedBlockAstThe ast representing a begin, process, end, or dynamic parameter block in a scriptblock. This ast is used even when the block is unnamed, in which case the block is either an end block (for functions) or process block (for filters).
NullStringRepresents a type that can be used to pass null into a .NET method that has a string parameter.
NumberTokenA constant number token. The value may be any numeric type including int, long, double, or decimal.
ParamBlockAstThe ast representing the parameter statement in a script block.
ParameterAstThe ast representing a parameter to a script. Parameters may appear in one of 2 places, either just after the name of the function, e.g. function foo($a){} or in a param statement, e.g. param($a).
ParameterBindingResult 
ParameterTokenA parameter to a cmdlet (always starts with a dash, like -Path).
ParenExpressionAstThe ast that represents an expression (or pipeline) that is enclosed in parentheses, e.g. (1) or (dir)
ParseErrorRepresents a parsing error.
ParserThe parser that parses PowerShell script and returns a ScriptBlockAst, tokens, and error messages if the script cannot be parsed successfullly.
PipelineAstThe ast that repesents a PowerShell pipeline, e.g. gci -re . *.cs | select-string Foo or 65..90 | % { [char]$_ }. A pipeline must have at least 1 command. The first command may be an expression or a command invocation.
PipelineBaseAstAn abstract base class for statements that include command invocations, pipelines, expressions, and assignements. Any statement that does not begin with a keyword is derives from PipelineBastAst.
RedirectionAstAn abstract base class representing both file redirections and merging redirections.
RedirectionTokenAn abstract base class for merging and file redirections.
ReflectionTypeNameContains functionality that allows a Type to be used directly in the PowerShell abstract syntax tree.
ReturnStatementAstThe ast representing the return statement.
ScriptBlockAstRepresents the root node of an abstract syntax tree for a complete script.
ScriptBlockExpressionAstRepresents the abstract syntax tree for an anonymous script block expression, such as { dir }.
ScriptExtentRepresents a script extent used to customize the display of error location information.
ScriptPositionRepresents a single point in a script.
ScriptRequirementsRepresents the requirements of a script.
StatementAstAn abstract base class for any statement like an if statement or a while statement.
StatementBlockAstThe ast representing a block of statements. The block of statements could be part of a script block or some other statement such as an if statement or a while statement.
StaticBindingError 
StaticBindingResult 
StaticParameterBinder 
StringConstantExpressionAstThe ast that represents a constant string expression that is always constant. This includes both single and double quoted strings, but the double quoted strings will not be scanned for variable references and sub-expressions. If expansion of the string is required, use ExpandableStringExpressionAst.
StringExpandableTokenA double quoted string, or a double quoted here string.
StringLiteralTokenA single quoted string, or a single quoted here string.
StringTokenThe base class for any string token, including single quoted string, double quoted strings, and here strings.
SubExpressionAstRepresents the abstract syntax tree of a subexpression, such as $(1).
SwitchStatementAstThe ast that represents a switch statement.
ThrowStatementAstThe ast representing the throw statement.
TokenRepresents many of the various PowerShell tokens, and is the base class for all PowerShell tokens.
TokenTraitsSpecifies a utility class to get statically known traits and invariant traits about PowerShell tokens.
TrapStatementAstThe ast that represents the trap statement.
TryStatementAstThe ast that represents a try statement.
TypeConstraintAstRepresents the abstract syntax tree of a type constraint, which is simply a type name with no arguments.
TypeExpressionAstThe ast that represents a type literal expression, e.g. [int].
TypeNameRepresents a simple type that is not an array or does not have generic arguments.
UnaryExpressionAstThe ast representing an expression with a unary operator.
UsingExpressionAstRepresents the abstract syntax tree of a using expression, such as $using:pshome.
VariableExpressionAstRepresents the abstract syntax tree of a variable reference.
VariableTokenA variable token that is either a regular variable, such as $_, or a splatted variable like @PSBoundParameters.
WhileStatementAstThe ast for a while statement.

InterfaceDescription
ICustomAstVisitorRepresents functionality to be invoked on nodes of different types when an abstract syntax tree is traversed, and controls the order in which the tree is traversed.
IScriptExtentRepresents a span of text in a script.
IScriptPositionRepresents a single point in a script.
ITypeNameRepresents the name and the attributes of a type.

EnumerationDescription
AstVisitActionEach Visit* method in `Malformed returns one of these values to control how visiting nodes in the AST should proceed.
DynamicKeywordBodyMode 
DynamicKeywordNameMode 
ForEachFlagsFlags that are specified on a foreach statement. Values may be or'ed together, not all invalid combinations of flags are detected.
RedirectionStreamThe stream number that is redirected.
StringConstantTypeThe kind of string constant.
SwitchFlagsThe flags that are specified on a switch statement. Values may be or'ed together, not all invalid combinations of flags are detected.
TokenFlagsFlags that specify additional information about a given token.
TokenKindThe specific kind of token.

Send comments about this topic to Microsoft.
Show:
© 2014 Microsoft