Change CommandInfoCache to implement IDisposable and clean up the runspace pool by JamesWTruher · Pull Request #1335 · PowerShell/PSScriptAnalyzer
The Helper is recreated with every invocation of Invoke-ScriptAnalyzer which essentially resulted in a runspace which was not cleaned up for every invocation. I saw 100s of runspaces (ia get-runspace) in my session. I also gave the CommandInfoCache it's own runspace pool and implemented IDisposable in it. Lastly, I've added a test to catch this in the future.
JamesWTruher
changed the title
Change helper to implement IDisposable and clean up the runspace pool
Change CommandInfoCache to implement IDisposable and clean up the runspace pool
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters