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

Closed
KirkMunro opened this Issue May 21, 2015 · 3 comments

Comments

Projects
None yet
3 participants
@KirkMunro
Contributor

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

@yutingc

This comment has been minimized.

Show comment
Hide comment
@yutingc

yutingc May 21, 2015

Contributor

Thanks @KirkMunro, we will fix this issue soon.

Contributor

yutingc commented May 21, 2015

Thanks @KirkMunro, we will fix this issue soon.

@yutingc yutingc self-assigned this May 21, 2015

@yutingc

This comment has been minimized.

Show comment
Hide comment
@yutingc

yutingc Jun 9, 2015

Contributor

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?

Contributor

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?

@quoctruong

This comment has been minimized.

Show comment
Hide comment
@quoctruong

quoctruong Jun 24, 2015

Seems like this issue is already fixed.

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