[英]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.