I'm a PowerShell fan and have recently adopted PowerShell Core as my version of choice. If you are not familiar with PowerShell Core, it is a cross platform (Windows, Linux, and macOS) version of PowerShell based on .NET Core. That said, I sometimes need to work in PowerShell for Windows or use both side by side.
In this post, I will detail how I've used the Shell Launcher Visual Studio Code extension to configure my Windows system to run PowerShell Core and PowerShell for Windows side by side.
In order to do this yourself, you need a Windows-based system with both Visual Studio Code and PowerShell Core installed.
Before configuring Shell Launcher, I want to set PowerShell Core as the default PowerShell version. To do so, open up the VS Code user settings.json file by clicking on file > preferences > settings, select ... and then Open settings.json.
Modify the settings.json file to include terminal.integrated.shell.windows. The update must be well formed json. If you have other settings in your settings.json file, you may need to adjust the following example.
Before using shell launcher, a key binding needs to be created to engage the shell launcher.
Open up the Visual Studio Code keybindings.json file by clicking on file > preferences > Keyboard Shortcuts and then selecting keybindins.json.
Add the following to the keybindings.json file to configure ctrl + shift + t as the shell launcher key binding. The update must be well formed json. If you have other settings in your keybindins.json file, you may need to adjust this example.
Open up the VS Code user settings.json file by clicking on file > preferences > settings, select ... and then Open settings.json.
Adding the following to the settings.json file configures two shells, one with PowerShell Core and another with Windows PowerShell. You can adjust the display names (labels), as well as add additional shells such as WSL and CMD.
Now, when initiating the Shell Launcher, you should see a menu similar to this. Select the desired version of PowerShell and rock on.
To run both versions of PowerShell side by side, open a terminal with the non-default version of PowerShell (PowerShell for Windows in my case), and then click the split terminal button. This will open another side-by-side terminal with the other PowerShell version (PowerShell Core in my case).
Fully configured settings.json file
For completeness, here is a full copy of a settigns.json file with everything detailed in this post.