Open
Description
Like the title says, it would be useful if I was warned whenever I try to reuse a global variable's name in a more local scope.
$a = 'Unchanged'
function foo {
Write-Host "foo can read `$a : `$a = $a"
$a = 'Changed from foo' # this should be warning!!
Write-Host "foo can change it's own copy of `$a: `$a = $a"
}
foo
Write-Host "After foo call: `$a = $a"
Thanks to @vors for the example.