PowerShell Core 7 is the latest version of the cross-platform scripting and automation tool from Microsoft. It is based on .NET Core and offers many new features and improvements over the previous versions of PowerShell. PowerShell Core 7 can run side-by-side with Windows PowerShell 5.1, so you can use both versions on your machine.
Visual Studio Code is a popular code editor and development environment that supports many languages and platforms. It also has a built-in terminal that allows you to run commands and scripts from within the editor. By default, Visual Studio Code uses the Windows PowerShell 5.1 as the terminal on Windows 11, but you can change it to use PowerShell Core 7 instead.
In this blog post, I will show you how to install PowerShell Core 7 on your Windows 11 machine and how to activate it as the default terminal in Visual Studio Code.
Prerequisites
- A Windows 11 machine with administrator privileges.
- Visual Studio Code installed on your machine. You can download it from https://code.visualstudio.com/download.
- An internet connection to download and install PowerShell Core 7.
Step 1: Download and Install PowerShell Core 7
To download and install PowerShell Core 7, follow these steps:
- Open Visual Studio Code after you installed it. On the top Menu click “Terminal”->”New Terminal”
- You can now type $PSVersiontable to see that you are running Windows PowerShell version 5.1.
- Next step is to install PowerShell 7. This can be done from inside PowerShell by running first command shows available versions, second command installs PowerShell:
winget search Microsoft.PowerShell
winget install --id Microsoft.Powershell
- When PowerShell Core is installed you need to restart Visual Studio Code and also make sure that you kill the Terminal Window that is opened.
Step 2: Activate PowerShell Core 7 as the Default Terminal in Visual Studio Code
To activate PowerShell Core 7 as the default terminal in Visual Studio Code, follow these steps:
- Open Visual Studio Code and click on the Terminal menu at the top.
- Select New Terminal to open a new terminal window at the bottom of the editor.
- Click on the drop-down menu next to the plus sign (+) at the top right corner of the terminal window and select Select Default Profile.

- From the list of available profiles, select PowerShell Core 7 and click on OK.

- Close the current terminal window and open a new one. You should see PowerShell Core 7 as the default terminal.
- Run the PS Version Table($PSVersionTable) to make sure you running the correct version.
Summary
Now you have some easy steps to manage Terminal PowerShell versions in Visual Studio Code. Good luck with your scripting.