-
Notifications
You must be signed in to change notification settings - Fork 409
Open
Description
Not sure whether this is a PowerShell a bug or feature but fixing it in PowerShell would probably be a break change.
In any case, I think unknown labels should be notified and even deserve an error severity if the label doesn't exist or is outside the concerned loop.
Invoke-ScriptAnalyzer -ScriptDefinition {
:foo foreach ($a in 1,2,3) {
$a
if ($a -ge $b) { break bar }
}
}.ToString()Expected
Something like:
RuleName Severity ScriptName Line Message
-------- -------- ---------- ---- -------
PSUnknownLabel Error 4 The label 'bar' is not known in this context
Metadata
Metadata
Assignees
Labels
No labels