Reputation: 17469
How do I add the Visual Studio Developer's Command Prompt to the list of Windows Terminal consoles?
Upvotes: 30
Views: 8733
Reputation: 145
VisualStudio developer prompts are now in Windows Terminal stable (1.12)! https://twitter.com/mrhestew/status/1489322750330085380
winget upgrade -e Microsoft.WindowsTerminal
Upvotes: 6
Reputation: 839
For VS 2022 Community:
{
"name": "Developer PowerShell for VS 2022",
"commandline": "powershell.exe -noe -c \"&{$vsPath = &(Join-Path ${env:ProgramFiles(x86)} '\\Microsoft Visual Studio\\Installer\\vswhere.exe') -property installationpath; Import-Module (Join-Path $vsPath 'Common7\\Tools\\Microsoft.VisualStudio.DevShell.dll'); Enter-VsDevShell -VsInstallPath $vsPath -SkipAutomaticLocation}\"",
"icon": "%ProgramFiles%\\Microsoft Visual Studio\\2022\\Community\\Common7\\IDE\\Assets\\VisualStudio.70x70.contrast-standard_scale-180.png"
},
{
"name": "Developer Command Prompt for VS 2022",
"commandline": "%comspec% /k \"%ProgramFiles%\\Microsoft Visual Studio\\2022\\Community\\Common7\\Tools\\VsDevCmd.bat\"",
"icon": "%ProgramFiles%\\Microsoft Visual Studio\\2022\\Community\\Common7\\IDE\\Assets\\VisualStudio.70x70.contrast-standard_scale-180.png"
}
Upvotes: 7
Reputation: 8337
The answer from Wallace Kelly is great, but the settings below may be a useful copy/paste for others who want Visual Studio icons, both x86 and x64 and a less DOS-like font.
As with Wallace's answer, adjust "2019" and "Professional", e.g. for 2017/Community, as needed.
{
"guid": "{9a3a9308-d6f8-4b1d-896c-a27c59c28be3}",
"name": "VS2019 x86",
"commandline": "cmd.exe /k cd c:/dev/mc-hardware-svc/out/vs-x86-Debug && \"C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/VC/Auxiliary/Build/vcvars32.bat\"",
"fontFace": "Consolas",
"fontSize": 10,
"icon" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/Common7/IDE/Assets/VisualStudio.70x70.contrast-black_scale-80.png",
"hidden": false
},
{
"guid": "{ceec68f2-0ef7-48f0-84db-4693612532cd}",
"name": "VS2019 x64",
"commandline": "cmd.exe /k \"C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/VC/Auxiliary/Build/vcvars64.bat\"",
"icon" : "C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/Common7/IDE/Assets/VisualStudio.70x70.contrast-black_scale-80.png",
"hidden": false
},
Upvotes: 8
Reputation: 17469
Select Settings, which will open a JSON file.
Paste the following to the array of profiles in the JSON, changing 2019 to 2017 and Professional to Community to match your install.
,
{
"guid" : "{1748ecca-abdd-4aa4-bcc4-9fca0d045be5}",
"name" : "VS cmd",
"commandline" : "cmd.exe /k \"%PROGRAMFILES(X86)%\\Microsoft Visual Studio\\2019\\Professional\\Common7\\Tools\\VsDevCmd.bat\"",
"icon" : "ms-appx:///ProfileIcons/{0caa0dad-35be-5f56-a8ff-afceeeaa6101}.png",
"hidden": false
}
Upvotes: 42