How to Configure Visual Studio Code to run PowerShell for Windows and PowerShell Core Simultaneously

How to Configure Visual Studio Code to run PowerShell for Windows and PowerShell Core Simultaneously
I’m a PowerShell fan and have actually just recently embraced PowerShell Core as my variation of option. If you are not knowledgeable about PowerShell Core, it is a cross platform (Windows, Linux, and macOS) variation of PowerShell based on.NET Core. That stated, I in some cases require to operate in PowerShell for Windows or utilize both side by side.

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 file > choices > settings, choose ... and after that Open settings.json

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 1.1.0.1 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.

Like this post? Please share to your friends:
Leave a Reply

;-) :| :x :twisted: :smile: :shock: :sad: :roll: :razz: :oops: :o :mrgreen: :lol: :idea: :grin: :evil: :cry: :cool: :arrow: :???: :?: :!: