In this post, I will information how I’ve utilized 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 require a Windows-based system with both Visual Studio Code and PowerShell Core set up.
For more details on PowerShell Core see Installing PowerShell Core on Windows
Configure default PowerShell variation
Before setting up Shell Launcher, I wish to set PowerShell Core as the default PowerShell variation. To do so, open the VS Code user settings.json file by clicking
... and after that
Modify the settings.json file to consist of
terminal.integrated.shell.windows The upgrade need to be well formed json. If you have other settings in your settings.json file, you might require to change the copying.
[" terminal.integrated.shell.windows": "c:/ Program Files/PowerShell/6/ pwsh.exe"]
Now, when opening a terminal in Visual Studio Code, PowerShell core must be the default variation.
PS C: storage code azure-powershell-demos > $PSVersionTable Name Value-- ----- PSVersion 6.1.0 PSEdition Core GitCommitId 6.1.0 OS Microsoft Windows 10.0.17134 Platform Win32 NT PSCompatibleVersions [1.0, 2.0, 3.0, 4.0 ...] PSRemotingProtocolVersion 2.3 SerializationVersion 18.104.22.168 WSManStackVersion 3.0
Install the Shell Launcher Visual Studio Code extension
The crucial to opening PowerShell Core and PowerShell for Windows side by side is the Shell Launcher Visual Studio Code extension Shell Launcher enables you to set up several shells within Visual Studio Code.
Install the extension by clicking the Visual Studio Code extensions button and browsing the marketplace location for
shell launcher When situated, click set up.
Thanks a lot to Daniel Imms for assembling this extension. Make sure to inspect our more extensions by Daniel, which can be discovered here – https://marketplace.visualstudio.com/publishers/Tyriar
Configure keyboard bindings for Shell Launcher
Before utilizing shell launcher, an essential binding requires to be produced to engage the shell launcher.