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

VS Code终端运行代码报错求助:PowerShell进程退出代码4294901760

解决VS Code中PowerShell进程退出码4294901760的问题

以下是几个经过验证的可行解决方案,按顺序尝试:

  • 检查并修改PowerShell执行策略
    打开管理员权限的PowerShell窗口,执行Get-ExecutionPolicy查看当前策略。如果返回Restricted,执行Set-ExecutionPolicy RemoteSigned,输入Y确认更改。该策略限制会阻止脚本运行,是触发该错误的常见原因。

  • 重置VS Code终端配置
    打开VS Code设置(快捷键Ctrl+,),搜索terminal.integrated.profiles.windows,点击编辑 in settings.json,替换为以下默认配置:

    "terminal.integrated.profiles.windows": {
        "PowerShell": {
            "source": "PowerShell",
            "icon": "terminal-powershell"
        }
    },
    "terminal.integrated.defaultProfile.windows": "PowerShell"
    

    保存配置后重启VS Code,避免自定义配置导致的终端启动失败。

  • 修复PowerShell安装
    打开Windows设置→应用→应用和功能,找到PowerShell,点击修改,选择修复选项完成修复流程,之后重启电脑。该操作会修复PowerShell的损坏文件。

  • 关闭PowerShell的兼容性模式
    找到C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe,右键选择属性,切换到兼容性标签页,取消勾选以兼容模式运行这个程序,点击确定后重启VS Code。

  • 更新VS Code及PowerShell扩展
    打开VS Code扩展面板,找到PowerShell扩展检查并安装更新;同时将VS Code升级到最新版本,新版本通常会修复终端相关的兼容性问题。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.05 00:11:01