Skip to content

Commit 6d82a67

Browse files
StartAutomatingStartAutomating
authored andcommitted
VariableExpressionAst.GetVariableType - Enabling InvokeMemberExpression (Fixes #490)
1 parent 3939df7 commit 6d82a67

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

docs/System.Management.Automation.Language.VariableExpressionAst.GetVariableType.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ This looks for the closest assignment statement and uses this to determine what
3131
$y = 2
3232
$x + $y
3333
}.Ast.EndBlock.Statements[-1].PipelineElements[0].Expression.Left.GetVariableType()
34+
# Should -Be ([int])
3435
```
3536

3637
#### EXAMPLE 2
@@ -39,6 +40,15 @@ This looks for the closest assignment statement and uses this to determine what
3940
$x = Get-Process
4041
$x + $y
4142
}.Ast.EndBlock.Statements[-1].PipelineElements[0].Expression.Left.GetVariableType()
43+
# Should -Be ([Diagnostics.Process])
44+
```
45+
46+
#### EXAMPLE 3
47+
```PowerShell
48+
{
49+
$x = [type].name
50+
$x
51+
}.Ast.EndBlock.Statements[-1].PipelineElements[0].Expression.GetVariableType()
4252
```
4353

4454

0 commit comments

Comments
 (0)