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
相关产品推荐
相关产品推荐

