Skip to content

Incorrectly reports variable assigned but never used for globals #418

@FrankDomina

Description

@FrankDomina

If you assign a value to a global variable, for example $global:fubar="snafu", it reports "The variable 'fubar' is assigned but never used." when in fact it is used elsewhere, such as within a different function.

Please either fix this for all "$global:" variables so that if they're referenced anywhere within the script, no warning is emitted....or at the very least give the option to disable that warning specifically or global variables.

(I imagine the same issue exists for script-level variables, too, though I have not checked that.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions