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

Windows PowerShell无法运行及VS Code终端无法打开问题求助

解决方案:64位PowerShell故障+VS Code终端无法打开

针对你遇到的64位PowerShell报错、VS Code终端无法启动(仅x86版PowerShell正常)的问题,结合你已尝试的修复手段,给出以下针对性方案:

  • 检查并修复64位PowerShell执行策略
    打开正常的x86版PowerShell(管理员权限),执行命令:

    Get-ExecutionPolicy -List
    

    查看LocalMachine或CurrentUser层级的64位执行策略是否被设为Restricted。如果是,执行:

    Set-ExecutionPolicy RemoteSigned -Scope LocalMachine
    

    按提示确认修改后,尝试启动64位PowerShell。

  • 修复PowerShell注册表项
    打开注册表编辑器(regedit),定位到HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell,确认ExecutionPolicy键值为RemoteSigned;同时对比HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell(x86版注册表项),确保64位路径下的注册表项无缺失或异常。

  • 重置VS Code终端配置

    1. 打开VS Code,按下Ctrl+Shift+P打开命令面板,输入Terminal: Select Default Profile,选择Windows PowerShell(64位版本,路径为C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe)。
    2. 再次打开命令面板,输入Terminal: Reset Terminal,重启终端测试。
    3. 若仍有问题,打开VS Code设置(Ctrl+,),搜索terminal.integrated.profiles.windows,手动确认PowerShell的路径指向64位可执行文件,而非x86的C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe。
  • 重新注册64位PowerShell组件
    在管理员权限的x86版PowerShell中执行以下命令,重新注册64位PowerShell的应用包:

    %SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy RemoteSigned -Command "Get-AppXPackage -AllUsers | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}"
    

    执行完成后重启设备,测试64位PowerShell和VS Code终端。

  • 卸载近期Windows更新
    既然推测问题由Windows更新导致,可尝试卸载两个月后安装的更新:

    1. 打开Windows设置→Windows更新→更新历史记录→卸载更新。
    2. 找到最近安装的KB系列更新,逐个卸载后重启设备,测试问题是否解决。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.06.29 08:12:17