Work around runspacepool deadlock by rjmholt · Pull Request #1316 · PowerShell/PSScriptAnalyzer

Is this issue a blocker for a release of a newer version of the vs code ps extension (which would implicitly start to ship with PSSA 1.18.1)?

Yes it is. Ideally I'd like to address this issue and area more fully, but for now just trying to unblock.

Is it possible to have a simpler test case with a less complex file (either instead or additionally)?

So far this is the only good repro I've found in PSSA. Even then it's not 100%, but better than nothing.

What if more get discovered?

We've seen this in PSES as well and known about it for some time. It's because PkgMgmt does some extremely unusual threaded things to generate its dynamic parameters. Given that we haven't found any other cases and that this is caused by such a strange implementation, my feeling is thst the right approach is:

  • Hotfix for PackageManagement in PSSA (this can remain in, since old versions of PackageManagement will be out there in use)
  • Fix the issue in PackageManagement (which is more involved, and can't be relied upon to get to everyone)
  • See if the mechanism allowing this to happen can be fixed in PS 7
  • Possibly add more configurability to PSSA