Skip to content
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

PSAvoidGlobalVars should not warn when you are referencing built-in global variables #187

KirkMunro opened this issue May 21, 2015 · 3 comments


Copy link

@KirkMunro KirkMunro commented May 21, 2015

PowerShell defines many built-in global variables by default. When you reference one of these variables in a script or module using the "global:" scope qualifier, PSScriptAnalyzer generates a warning due to how the PSAvoidGlobalVars rules is written. When the variable is a global, built-in variable though, this warning should not be generated.

PSAvoidGlobalVars should be modified to exclude built-in, global variables that are defined by PowerShell.

@yutingc yutingc added this to the 1505 milestone May 21, 2015
@yutingc yutingc added the Issue - Bug label May 21, 2015
Copy link

@yutingc yutingc commented May 21, 2015

Thanks @KirkMunro, we will fix this issue soon.

@yutingc yutingc self-assigned this May 21, 2015
Copy link

@yutingc yutingc commented Jun 9, 2015

Hi @KirkMunro, in our implementation, we have already excluded most of the built-in variables when identifying global variables. Do you know which ones we are missing?

Copy link

@quoctruong quoctruong commented Jun 24, 2015

Seems like this issue is already fixed.

@quoctruong quoctruong closed this Jun 24, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.