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

Windows10 PowerShell5中AZ CLI无法识别问题求助

AZ CLI在PowerShell 5.1中无法识别,但命令提示符可正常使用

近期测试代码后,AZ CLI环境出现异常:在命令提示符中可正常执行az命令,但在PowerShell 5.1(版本5.1.19041.1682)中执行时提示“‘az’未被识别为 cmdlet 名称”。

已执行以下操作但问题未解决:

  • 卸载AZ CLI并重启电脑
  • 运行官方安装命令:
    Invoke-WebRequest -Uri https://aka.ms/installazurecliwindows -OutFile .\AzureCLI.msi; Start-Process msiexec.exe -Wait -ArgumentList '/I AzureCLI.msi /quiet'; rm .\AzureCLI.msi
    
  • 执行模块安装命令:
    Install-Module AzureAD -Force; Install-module AzureADPreview -Force; Install-Module -Name MSOnline -Force; Import-Module Az -Force; Install-Module Az -Force
    

怀疑问题与路径配置有关,此前运行的脚本曾修改过系统路径配置,之后电脑重启。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.18 19:45:33