We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 16c83bc commit 0d99b93Copy full SHA for 0d99b93
Types/ParameterAST/get_DisplayName.ps1
@@ -0,0 +1,18 @@
1
+foreach ($attr in $this.Attributes) {
2
+ $reflectedType = $attr.TypeName.GetReflectionType()
3
+ if ($reflectedType -ne [ComponentModel.DisplayNameAttribute]) {
4
+ continue
5
+ }
6
+
7
+ foreach ($positionalParameter in $attr.PositionalArguments) {
8
+ return $positionalParameter.Value
9
10
11
+ foreach ($namedArgument in $attr.NamedArguments) {
12
+ if ($namedArgument.ArgumentName -eq 'DisplayName') {
13
+ return $namedArgument.Argument.Value
14
15
16
+}
17
18
+return $this.Name.VariablePath.ToString()
0 commit comments