You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
PSScriptAnalyzer incorrectly flags a variable as assigned but never used #989
When a variable is declared either in the begin block or statement block of a ForEach-Object pipeline, the PSScriptAnalyzer incorrectly flags it as assigned but never used.
Examples:
$Count is incorreclty flagged as assigned but never used $myArray = @() $myArray += "Item1" $myArray += "Item2" $myArray += "Item3" $myArray += "Item4" $myArray | ForEach-Object {$Count = 0} {$Count++; $Count}
Activity
daviwil commentedon Aug 14, 2017
This is covered by PowerShell/PSScriptAnalyzer#711, will close this issue in favor of that one.