Change VSCode Integrated Terminal to PowerShell

Visual Studio Code is an excellent developer tool for PowerShell projects. However, regardless of which type of project you’re developing (C#, Node.js, Python, etc.), you can benefit from changing your default shell to the powerful, object-oriented PowerShell shell. Now, you may not want to change your default shell for the entire operating system. VSCode thankfully exposes a configuration option that allows you to change the default shell only for the VSCode Integrated Terminal. This won’t affect the default shell for your host operating system.

To change your default shell for VSCode to PowerShell Core, simply:

  1. Install Visual Studio Code
  2. Install PowerShell Core
  3. Hit CMD + , (Mac OS X) to open your User Settings, or search for it via the Command Palette (F1 key)
  4. Add the option to your JSON configuration
  5. Set the value of the option to /usr/local/bin/powershell

If PowerShell Core is installed to a different location, you can use the which powershell command from a Bash or ZSH shell to locate the binary. Then, populate the path accordingly in your VSCode User Settings configuration. If you’re using Linux or Windows, instead of Mac OS X, then you’ll simply replace the setting with or VSCode’s User Settings supports JSON schema Intellisense, so as you type the setting, it will auto-complete for you.

Here’s what my current User Settings file looks like.

Visual Studio Code :: Integrated Terminal Setting

UPDATE (2018-03-18): Make sure you use the new binary name /usr/local/bin/pwsh instead of /usr/local/bin/powershell! Thanks to Zach Knight for calling this out. I’ve updated the screenshot below.

As you can see, now that I’ve changed my default shell, hitting CTRL + ` (backtick) results in a shiny new PowerShell instance directly inside of VSCode!

Visual Studio Code :: Integrated Terminal :: PowerShell

Follow me on Twitter and check out my YouTube videos.