| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Explicitly included Where-Object and ForEach-Object scriptblocks to also be searched for variable use
There was a problem hiding this comment.
we're definitely going to need new validation for this behavior.
Please create tests for this.
Sorry, something went wrong.
|
Friedrich Weinmann (@FriedrichWeinmann) We plan to release later this month so if you could add some tests, we could potentially merge and ship this in time? |
Sorry, something went wrong.
|
Sorry about the delay, added tests |
Sorry, something went wrong.
There was a problem hiding this comment.
Friedrich Weinmann (@FriedrichWeinmann) Thanks for adding tests, whilst reviewing I just noticed that we need to document this new option.
Sorry, something went wrong.
There was a problem hiding this comment.
Thanks, LGTM now.
Sorry, something went wrong.
There was a problem hiding this comment.
looks great - thanks for adding the tests
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
PR Summary
Proposed resolution of the issue of PSReviewUnusedParameter not traversing into scriptblocks of common commands such as Where-Object or ForEach-Object (#1472).
Implementation:
Notes & Thoughts
This is currently not too refined, but works for what it does.
Does not address $using use in Invoke-Command or other edge cases (e.g. ForEach-Object -Parallel).
But it does solve the problem for the most common everyday usage and allows extensibility for people with custom needs (e.g. I'm going to explicitly include Invoke-PSFProtectedCommand).
Also does not cover special cases, such as calculated properties of Select-Object. Or scriptblocks stored in variables and later used as argument for commands that are whitelisted. Maybe more detailed configuration options needed for cases like that.
PR Checklist