Steps to reproduce
'foo' | ForEach-Object { $guy = 'bar' }; $guy
Expected behavior
Zero problem. Scope issue should be expected with Invoke-Command but not with ForEach-Object.
Actual behavior
The variable 'guy' is assigned but never used.PSScriptAnalyzer(PSUseDeclaredVarsMoreThanAssignments)

Environment data
PSScriptAnalyzer module version is 1.19.0.