File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -56,19 +56,21 @@ public static AttributeAst GetCmdletBindingAttributeAst(this ParamBlockAst param
56
56
{
57
57
throw new ArgumentNullException ( "attributeAsts" ) ;
58
58
}
59
+
59
60
foreach ( var attributeAst in attributeAsts )
60
61
{
61
- if ( attributeAst == null || attributeAst . NamedArguments == null )
62
- {
63
- continue ;
64
- }
65
- if ( attributeAst . TypeName . GetReflectionAttributeType ( )
66
- == typeof ( CmdletBindingAttribute ) )
62
+ if ( attributeAst != null && attributeAst . IsCmdletBindingAttributeAst ( ) )
67
63
{
68
64
return attributeAst ;
69
65
}
70
66
}
67
+
71
68
return null ;
72
69
}
70
+
71
+ public static bool IsCmdletBindingAttributeAst ( this AttributeAst attributeAst )
72
+ {
73
+ return attributeAst . TypeName . GetReflectionAttributeType ( ) == typeof ( CmdletBindingAttribute ) ;
74
+ }
73
75
}
74
76
}
You can’t perform that action at this time.
0 commit comments