Pester extension causes vscode to always open the PowerShell extension window even on non-PowerShell projects
My apologies (seriously) if this is a dupe, my search-fu is weak this morning - I did try. I'm running the latest released build of Pester.
Repro steps:
- On Windows 11, install vscode and Pester along with whatever it depends on.
- Open a pester project and make sure you can run tests.
- Close vscode.
- Open vscode and then open a folder that only contains Python scripts - no PowerShell whatsoever.
Expected results: vscode opens and just sits there.
Actual results: vscode opens along with the PowerShell Extension Window.
Bonus: You can open a folder full of .txt files and see the same behavior.
Workaround: Disable the Pester extension globally and only enable it if you're writing Pester tests in that project.
Thanks.
Thanks for your submission!
The Pester extension does activate on onStartupFinished if no pester tests exist (because a user can specify custom pester test name paths), and has a lazy initialization process. It shouldn't activate a PowerShell window if it doesn't find any tests, that's the first step, so I can see if there's something going wrong in that startup logic.
No guarantees on timeframe ATM, I do plan on improving this extension but I have other higher priorities at the moment.
No worries and thanks so much! I've had it happen across three PCs, though they were all pretty much running the same thing. So if it's me, I'm at least messing something up consistently.