You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am not sure whats the reason behind having only limited number of variables (may be they are read-only ?). But the rule name conveys different meaning.
We should change the rule name or let it flag all the automatic variable or make it ConfigurableRule
The text was updated successfully, but these errors were encountered:
jegannathanmaniganadan
changed the title
Update PSAvoidAssignmentToAutomaticVariable with all the automatic variable
Update PSAvoidAssignmentToAutomaticVariable to detect all the automatic variables
Mar 22, 2019
The reason why it flags the readonly ones at the moment is because one can be sure that assignment to those does not make sense. There are built in variables that can be assigned to by fesign, therefore we cannot just flag against all of those. But there are certainly a few more variables that we could add to the list, the work just has not been done yet to determine which other variables we should also warn against. I'd be happy to discuss it if someone like you does the research and adds more variables to it. The $args variable is one of those that I personally would like to add.
bergmeister
changed the title
Update PSAvoidAssignmentToAutomaticVariable to detect all the automatic variables
Update PSAvoidAssignmentToAutomaticVariable to detect more automatic variables
Mar 22, 2019
Ideally, we should just add the variables that we sure of should not be modified to the blacklist so that everyone can benefit from it but having an optional configuration that allows to add more variables would be possible as well. Feel free to create a PR either
I think this rule detects only limited number of automatic variables, we should probably update this with https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_automatic_variables?view=powershell-6
I am not sure whats the reason behind having only limited number of variables (may be they are read-only ?). But the rule name conveys different meaning.
We should change the rule name or let it flag all the automatic variable or make it ConfigurableRule
The text was updated successfully, but these errors were encountered: