-
Notifications
You must be signed in to change notification settings - Fork 378
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PSAvoidAssignmentToAutomaticVariable Errors on validateset #1970
Comments
This is a strange one. Ultimately That's why, in the terminal, when I use the parameter completion that But accepting the suggestions, the function errors: New-SlackMessage: Cannot process argument transformation on parameter 'UnfurlLinks'. Cannot convert value "System.String" to type "System.Boolean". Boolean parameters accept only Boolean values and numbers, such as $True, $False, 1 or 0. Which makes me think the function needs some work if it's using That all said, you're correct and it's not assignment. The rule is probably checking all parameters for any variable expressions and alerting if a reserved name is used. I'll take a look at this. |
it's not that This attribute is really looking for a set of constant strings |
Thanks for the explanation @JamesWTruher. Makes sense! |
Thanks for raising this and opening PR, will review |
I have been getting errors on validateset because PSScriptAnalyzer is confusing the validateset as assignment.
An example of this happening is
from https://github.com/RamblingCookieMonster/PSSlack/blob/master/PSSlack/Public/New-SlackMessage.ps1
The text was updated successfully, but these errors were encountered: