Skip to content

UseConsistentWhitespace: Fix CheckParameter bug when using interpolated string#1498

Merged
bergmeister merged 1 commit intoPowerShell:masterfrom
bergmeister:issue1495
May 18, 2020
Merged

UseConsistentWhitespace: Fix CheckParameter bug when using interpolated string#1498
bergmeister merged 1 commit intoPowerShell:masterfrom
bergmeister:issue1495

Conversation

@bergmeister
Copy link
Collaborator

@bergmeister bergmeister commented May 14, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CheckParameter option of UseConsistentWhitespace (off by default): When turned, on removes part of script

2 participants