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

运行Microsoft激活脚本提示Powershell未安装,但已安装该程序

问题描述

运行Microsoft Activation Scripts AIO 1.4脚本时,触发错误提示:

Powershell is not installed in the system. Aborting...
但本地系统已实际安装PowerShell,相关错误截图与已安装证明截图已附上。

排查与解决步骤
  • 检查PowerShell的系统PATH配置
    打开命令提示符(cmd),输入powershell,若无法启动PowerShell,说明其未添加到系统环境变量的PATH中。手动添加步骤:

    1. 右键「此电脑」→ 属性 → 高级系统设置 → 环境变量
    2. 在「系统变量」中找到Path,点击编辑
    3. 添加PowerShell的安装路径,常见路径为C:\Windows\System32\WindowsPowerShell\v1.0\(PowerShell 5.1)或C:\Program Files\PowerShell\7\(PowerShell 7+)
    4. 保存配置后,重启命令提示符或脚本运行环境
  • 验证版本兼容性
    打开PowerShell,执行$PSVersionTable.PSVersion查看当前版本。部分旧版脚本仅兼容PowerShell 5.1,若安装的是7+版本,可尝试兼容模式运行:
    右键脚本文件 → 属性 → 兼容性 → 勾选「以兼容模式运行这个程序」,选择对应Windows版本(如Windows 10)

  • 修复PowerShell安装
    若路径配置正常仍报错,可能是安装文件损坏:

    1. 打开设置 → 应用 → 应用和功能
    2. 找到对应版本的PowerShell,点击「修改」或「修复」
    3. 完成修复后重新运行脚本
  • 修正脚本检测逻辑
    部分脚本依赖默认路径检测PowerShell,非默认安装路径会导致误判。可打开脚本文件(用记事本或PowerShell ISE),搜索检测PowerShell的代码段,补充你的实际安装路径判断。例如找到类似:

    if (-not (Test-Path "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe")) {
        Write-Error "Powershell is not installed in the system. Aborting..."
        exit
    }
    

    可修改为:

    $psPaths = @(
        "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe",
        "C:\Program Files\PowerShell\7\pwsh.exe" # 替换为你的实际安装路径
    )
    if (-not ($psPaths | Test-Path)) {
        Write-Error "Powershell is not installed in the system. Aborting..."
        exit
    }
    

内容的提问来源于stack exchange,提问作者Engr. Khuram Shahzad

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.23 14:40:05