[英]Can't install Azure Module in PowerShell
安装 Azure 模块时:
PS> Install-Module -Name Az -Scope CurrentUser -Repository PSGallery -Force
我收到此错误:
PackageManagement\Install-Package:找不到路径“C:\Users\MB\Documents\WindowsPowerShell\Modules\Az.Accounts\1.7.1”的一部分。 在 C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:1809 char:21
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
您最好的选择是从头开始:
以管理员身份启动 PS 并将 NuGet 更新到最新版本:
Install-PackageProvider -Name NuGet -Force -Scope AllUsers
在同一窗口中安装最新版本的 PackageProvider:
Install-Module -Name PackageManagement -Scope AllUsers -Force -AllowClobber
在同一窗口中安装最新版本的 PowerShellGet
Install-Module -Name PowerShellGet -Scope AllUsers -Force -AllowClobber
安装 Azure
Install-Module -Name Az -Scope CurrentUser -Force -Allowclobber
根据微软的说法,您也可以直接安装 MSI,因为他们的 Powershell 模块安装程序目前已损坏。
根据文档:
( https://docs.microsoft.com/en-us/powershell/azure/install-az-ps-msi )
导航到 Azure Github 发布页面https://github.com/Azure/azure-powershell/releases
向下滚动,直到找到包含 Az-Cmdlets-xxx-x64.msi 文件的最新 Assets chevron。
下载并安装 MSI。
重新启动 Powershell,你应该对 go 很好。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.