UseConsistentWhitespace: Fix CheckParameter bug when using interpolated string by bergmeister · Pull Request #1498 · PowerShell/PSScriptAnalyzer
PR Summary
Fixes #1495
I thought the searchNestedScriptBlocks: false option would not make it return nested objects in commandAst.FindAll. However, for an interpolated string, the VariableExpressionAst of the ExpendableStringExpressionAst is returned as well, therefore checking that only AST are returned whose parent is the commandAst.
PR Checklist
- PR has a meaningful title
- Use the present tense and imperative mood when describing your changes
- Summarized changes
- Change is not breaking
- Make sure all
.cs,.ps1and.psm1files have the correct copyright header - Make sure you've added a new test if existing tests do not effectively test the code changed and/or updated documentation
- This PR is ready to merge and is not Work in Progress.
- If the PR is work in progress, please add the prefix
WIP:to the beginning of the title and remove the prefix when the PR is ready.
- If the PR is work in progress, please add the prefix