I'm working on a project that requires me to compile C++ code using MSVC, but I am working mostly with VSCode. As such, I was wondering if there is a way for me to add the Developer Powershell as an integrated terminal, so that I can compile without needing a secondary terminal open. I thought of just opening VSCode from the Developer PS itself, but since this is mostly a temporary project it seemed like a lot of repetitive work. I tried using the Shell launcher
extension for VSCode but it didn't work. Is there anything I can do?

- 95
- 1
- 6
4 Answers
A variation of the answer of mklement0 is to use terminal.integrated.profiles.windows
in the Visual Studio Code settings.json
like this:
"terminal.integrated.profiles.windows": {
"Developer PowerShell for VS 2019": {
"source": "PowerShell",
"icon": "terminal-powershell",
"path": "{env:windir}\\SysWOW64\\WindowsPowerShell\\v1.0\\powershell.exe",
"args": [
"-noe",
"-c",
"&{Import-Module 'C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/Tools/Microsoft.VisualStudio.DevShell.dll'; Enter-VsDevShell 7068d947}"
]
}
}

- 121
- 1
- 5
-
1path is unnecessary since you already have "source": "PowerShell". Doing this also allows you to use powershell 7 – Shidouuu Mar 06 '22 at 20:38
To make Visual Studio Code's integrated terminal act like the Developer PowerShell for VS 2019
console that comes with Visual Studio 2019, add the following to your Visual Studio Code settings.json
file (> Preferences: Open Settings (JSON)
):
"terminal.integrated.shell.windows": "C:/Windows/SysWOW64/WindowsPowerShell/v1.0/powershell.exe"
and
"terminal.integrated.shellArgs.windows": "-noe -c Import-Module 'C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/Tools/Microsoft.VisualStudio.DevShell.dll'; Enter-VsDevShell ed9e071d"
Note that a 32-bit version of PowerShell is started, followed by import of a module and a call to a function from that module.
I've taken (and adapted) the commands - whose details may differ depending on the Visual Studio version - from the Properties dialog of the following shortcut file (*.lnk
):
C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Visual Studio 2019\Visual Studio Tools\Developer PowerShell for VS 2019.lnk

- 382,024
- 64
- 607
- 775
-
Is there a way to open a 64 bit version of the development tools as well? I tried looking around for it but there doesn't seem to be a clear way... – Carmo May 07 '20 at 19:27
-
2@Carmo If you replace `SysWOW64` with `System32`, you'll get a 64-bit PowerShell session - but I can't tell you whether everything will work as intended - do let us know. – mklement0 May 07 '20 at 19:29
-
It seems to start a powershell session, but the tools seem to be x64_86 tools. – Carmo May 07 '20 at 19:53
Update for Visual studio 2022 on my machine
"terminal.integrated.profiles.windows": {
"Developer PowerShell for VS 2022": {
"source": "PowerShell",
"icon": "terminal-powershell",
"args": [
"-noe",
"-c",
"&{Import-Module 'C:/Program Files (x86)/Microsoft Visual Studio/2022/Community/Common7/Tools/Microsoft.VisualStudio.DevShell.dll'; Enter-VsDevShell ed9e4c07}"
]
}
}

- 465
- 4
- 7
-
Follow up question, can I get it to start in the workspace root with these options? – Eduardo Serna Sep 13 '22 at 12:35
-
1@EduardoSerna Kind of. You can add `-WorkingDirectory C:\\Users\\eduar\\path\\to\\repo` as another argument (or two), but then it's hardcoded to that path. I haven't been able to find a way to get it to just automatically go to the workspace folder. – Grant G Jan 25 '23 at 22:24
I found this in March of 2023, looking for an answer to this question. At this point, Microsoft documents a Launch-VsDevShell.ps1
script that is the recommended way to start a developer PowerShell terminal. I tried simply making that script the path
parameter in the above JSON, but that didn't work. Then I tried making it the sole member of args
, and that seemed to work briefly and then exit. Finally, I added -NoExit
and that seems to work like a charm!
Of note for anyone coming after me, I'm using Visual Studio Community 2022 with an x86-64 install (so it's under C:\Program Files\
.
"Developer PowerShell for VS 2022": {
"source": "PowerShell",
"icon": "terminal-powershell",
"args": [
"-NoExit",
"C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/Tools/Launch-VsDevShell.ps1"
]
}

- 13,644
- 6
- 48
- 59