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
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'functionfoo {
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"