Skip to content

Commit ee4caa7

Browse files
author
James Brundage
committed
Updating ParameterAST Type Definitions (Fixes #305)
1 parent 6d4a18e commit ee4caa7

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
foreach ($attr in $this.Attributes) {
2+
$reflectedType = $attr.TypeName.GetReflectionType()
3+
if ($reflectedType -ne [Management.Automation.ParameterAttribute]) {
4+
continue
5+
}
6+
foreach ($namedArgument in $attr.NamedArguments) {
7+
if ($namedArgument.ArgumentName -ne 'ValueFromRemainingArguments') {
8+
continue
9+
}
10+
if ($namedArgument.Argument -and $namedArgument.Argument.Value) {
11+
return $true
12+
} elseif (-not $namedArgument.Argument) {
13+
return $true
14+
}
15+
}
16+
}
17+
18+
return $false

0 commit comments

Comments
 (0)