Fixed erroneous PSUseDeclaredVarsMoreThanAssignments for some globals variables by John-Leitch · Pull Request #2013 · PowerShell/PSScriptAnalyzer

added 2 commits

July 10, 2024 22:47

@bergmeister

bergmeister

andyleejordan

@John-Leitch

rjmholt added a commit to rjmholt/PSScriptAnalyzer that referenced this pull request

Feb 23, 2026
UseDeclaredVarsMoreThanAssignments (PowerShell#2013): skip scope-qualified
variable references ($global:, $script:, drive-qualified) when
checking for uses of local variables, preventing false negatives.

AvoidPositionalParameters (PowerShell#1850): skip commands that have no
parameters in the database (e.g. native CLI tools like az).

Co-authored-by: Cursor <cursoragent@cursor.com>