I am the wrong guy to answer that question. Sorry. I do everything from a shell. Bad habit learned from spending too much time in Linux.
I edit with VI and test/debug from shells. VI is by far and away the most powerful editor for coders there is. You can even use the VI extension in VSCode and get BOTH worlds, VI and Intellisense.
VSCode is the best editor for PowerShell one can get, suggesting to not using it is at best funny…
First of all, for your information, VSCode does not run your code to make something run slow.
Why is the command slow in this specific case, the answer could be in integrated shell which is by default PS Core.
It could be PS Core is having issues and not VSCode, I would suggest to test code in PS Core as opposed to Windows PowerShell and then make some judgements.
And if that makes any sense, VSCode can be configured to use Windows PowerShell instead of PS Core.