Does anyone have any idea on how to install/update PS 7 to be utilized by the VS Code Powershell Integrated Console. I can get PS 7 on the regular powershell terminal, however the Powershell Integrated Console is still PSVersion 5.1. I cannot seem to figure out how to change this. Any help would be much appreciated.
-
Having this in settings.json allows me to run pwsh as the integrated console ```"terminal.integrated.shell.windows": "C:\\Program Files\\PowerShell\\7\\pwsh.exe"```. – derekbaker783 Apr 29 '20 at 16:37
4 Answers
I'm using this code and it's working for me.
"powershell.powerShellAdditionalExePaths": [
{
"exePath": "C:\\Program Files\\PowerShell\\7\\pwsh.exe",
"versionName": "Downloaded PowerShell"
}
],
"powershell.powerShellDefaultVersion": "Downloaded PowerShell",
"terminal.integrated.shell.windows": "C:\\Program Files\\PowerShell\\7\\pwsh.exe",

- 8,598
- 83
- 57
- 92

- 381
- 1
- 8
Powershell 7.x (a.k.a. pwsh.exe, formerly known as Powershell Core) is now default shell in Visual Studio 2022. I think it should be the default Powershell version in VSCode (if extension detects Powershell 7+ is present). If user has it installed I think it should usually be the default now.
{
"powershell.powerShellAdditionalExePaths": [{
"exePath": "C:\\Program Files\\PowerShell\\7\\pwsh.exe",
"versionName": "PowerShell 7.x customized"
}],
"powershell.powerShellDefaultVersion": "PowerShell 7.x customized",
}

- 4,224
- 3
- 39
- 57
-
-
For some reason in my installation of vs2022 Powershell 7.x is not the default. I would love to make it the default. – John S Feb 09 '22 at 15:09
TLDR; specify the default profile that you would like to be loaded for your terminal in the settings.json file:
{
"terminal.integrated.defaultProfile.windows": "PowerShell",
"terminal.integrated.profiles.windows": {
"PowerShell": {
"source": "PowerShell"
}
}
}
The terminal setup has changed somewhat since the question was first asked.
The setting terminal.integrated.shell.windows
has been deprecated since, and is replaced by Terminal Profiles.
Also, the behaviour changes if you install the PowerShell extension. The extension adds its "own" integrated terminal experience. But specifying the 'default' profile should have the terminal start up with the profile that is specified.
Notice my setting sets the default as PowerShell
(aka Powershell Core), not Windows PowerShell

- 85
- 2
- 8
PowerShell for VS Code maintainer here. We're so sorry, but we accepted a PR that ended up being a breaking change to this setting. Notably this change provides support for configuring the setting via the GUI. This PowerShell Additional Exe Paths setting should now be configured as a dictionary of key/value pairs, like so:
{
"powershell.powerShellAdditionalExePaths": {
"Downloaded PowerShell": "C:/Users/username/Downloads/PowerShell/pwsh.exe",
"Built PowerShell": "C:/Users/username/src/PowerShell/src/powershell-win-core/bin/Debug/net6.0/win7-x64/publish/pwsh.exe"
},
"powershell.powerShellDefaultVersion": "Downloaded PowerShell",
}

- 255
- 2
- 9