We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6bdc6f4 commit 158812bCopy full SHA for 158812b
Rules/UseShouldProcessCorrectly.cs
@@ -350,7 +350,7 @@ private bool SupportsShouldProcess(string cmdName)
350
private bool TryGetShouldProcessValueFromAst(FunctionInfo functionInfo, out bool hasShouldProcessSet)
351
{
352
// Get the body of the function
353
- ScriptBlockAst functionBodyAst = (ScriptBlockAst)functionInfo.ScriptBlock.Ast.Find(ast => ast is ScriptBlockAst, searchNestedScriptBlocks: false);
+ ScriptBlockAst functionBodyAst = (ScriptBlockAst)functionInfo.ScriptBlock.Ast.Find(ast => ast is ScriptBlockAst, searchNestedScriptBlocks: true);
354
355
// Go through attributes on the parameter block, since this is where [CmdletBinding()] will be
356
foreach (AttributeAst attributeAst in functionBodyAst.ParamBlock.Attributes)
0 commit comments