Skip to content

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

@KirkMunro

Description

@KirkMunro

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions