◐ Shell
clean mode source ↗

UseUsingScopeModifierInNewRunspaces: Fix ArgumentException when the same variable name is used in 2 different sessions. by bergmeister · Pull Request #1493 · PowerShell/PSScriptAnalyzer

PR Summary

Fixes #1492 by checking if the variable name was already added. Also simplifying the code to be a HashSet<string> instead of a Dictionary<string,VariableExpressionAst> since the actual variable seems to be never used. Unfortunately I have to drop the IReadOnlyCollection for HashSet since we target .Net 4.5.2 and only starting with .Net 4.6, HashSet is implementing IReadOnlyCollection, see here.
cc @Jawz84

PR Checklist