PSReviewUnusedParameter
not finding script-param inside function scope (implicit and explicit)
#2017
Labels
PSReviewUnusedParameter
not finding script-param inside function scope (implicit and explicit)
#2017
Steps to reproduce
implicit:
explicit:
both scripts work as expected.
Expected behavior
no
PSReviewUnusedParameter
in either case.(Perhaps some "ambiguous" or "shadowing" warning/info in the second case, but that's not the point here)
Actual behavior
(both cases)
Environment data
Notes
We have several scripts that work similar to this (script-param used in "script-internal" functions) due to try-finally, try.catch, logging, or params like Endpoint-URI, Database-Name/Address,... that would not change during script execution. They are scripts, intended (and used as such) to be ran on their own, not modules. It would be horrible to read an maintain, if we had to explicitly pass all script-params to every relevant function again.
But it would still be ok if every reference had to use the
$script:
syntax, for strictness/debugging/maintainability/etc.The text was updated successfully, but these errors were encountered: