Open totkeks opened 2 years ago
The documentation here says: https://learn.microsoft.com/en-us/powershell/utility-modules/psscriptanalyzer/using-scriptanalyzer?view=ps-modules#suppressing-rules
Within the scope of the script, function, or parameter that you decorated, all rule violations are suppressed.
Therefore, this is currently by design. You need to either do this on the function where this line is or within the script file by putting a param()
block at the top.
Thanks for the reply! Putting the param()
block in the script file with all the argument completers works nicely and is appropriate since all of them have those three params.
Could we use this issue as a feature request for adding it to script blocks or should I create a separate feature request?
Before submitting a bug report:
Steps to reproduce
Expected behavior
Actual behavior
If an unexpected error was thrown then please report the full error details using e.g.
$error[0] | Select-Object *
Environment data