We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 49b5e0a commit 489938aCopy full SHA for 489938a
1 file changed
Engine/Extensions.cs
@@ -56,19 +56,21 @@ public static AttributeAst GetCmdletBindingAttributeAst(this ParamBlockAst param
56
{
57
throw new ArgumentNullException("attributeAsts");
58
}
59
+
60
foreach (var attributeAst in attributeAsts)
61
- if (attributeAst == null || attributeAst.NamedArguments == null)
62
- {
63
- continue;
64
- }
65
- if (attributeAst.TypeName.GetReflectionAttributeType()
66
- == typeof(CmdletBindingAttribute))
+ if (attributeAst != null && attributeAst.IsCmdletBindingAttributeAst())
67
68
return attributeAst;
69
70
71
return null;
72
+ public static bool IsCmdletBindingAttributeAst(this AttributeAst attributeAst)
+ {
73
+ return attributeAst.TypeName.GetReflectionAttributeType() == typeof(CmdletBindingAttribute);
74
+ }
75
76
0 commit comments