You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何将Visual Studio Developer Prompt添加为Visual Studio Code的终端Shell

在VS Code中配置Visual Studio Developer PowerShell终端
  • 打开VS Code设置:直接按Ctrl+,(Windows/Linux)或Cmd+,(Mac),也可以通过「文件」→「首选项」→「设置」打开。
  • 搜索terminal.integrated.profiles.windows,点击「编辑 in settings.json」进入配置文件。
  • 在配置里添加Visual Studio Developer PowerShell的专属配置(替换原有Windows终端配置或直接追加):
"terminal.integrated.profiles.windows": {
    "PowerShell": {
        "source": "PowerShell",
        "icon": "terminal-powershell"
    },
    "Command Prompt": {
        "path": [
            "${env:windir}\\Sysnative\\cmd.exe",
            "${env:windir}\\System32\\cmd.exe"
        ],
        "args": [],
        "icon": "terminal-cmd"
    },
    "Visual Studio Developer PowerShell": {
        "path": "powershell.exe",
        "args": [
            "-NoExit",
            "-Command",
            "& 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\Community\\Common7\\Tools\\Launch-VsDevShell.ps1'"
        ],
        "icon": "terminal-powershell"
    }
},
"terminal.integrated.defaultProfile.windows": "Visual Studio Developer PowerShell"
  • 注意:把路径里的2022\\Community改成你实际的VS版本(比如2019)和版本类型(比如Professional/Enterprise),确保路径指向正确的Launch-VsDevShell.ps1脚本。
  • 保存settings.json,重启VS Code终端(或直接重启VS Code),之后打开的终端就是Visual Studio Developer PowerShell会话,会自动加载VS的开发环境变量。

内容的提问来源于stack exchange,提问作者Schwarzie2478

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.20 05:05:47