Reputation: 41
When installing the Azure module:
PS> Install-Module -Name Az -Scope CurrentUser -Repository PSGallery -Force
I get this error:
PackageManagement\Install-Package : Could not find a part of the path 'C:\Users\MB\Documents\WindowsPowerShell\Modules\Az.Accounts\1.7.1'. At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:1809 char:21
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Upvotes: 4
Views: 7796
Reputation: 4894
According to Microsoft, you can also install the MSI directly since their Powershell module installer is broken at the moment.
According to the documentation:
(https://learn.microsoft.com/en-us/powershell/azure/install-az-ps-msi)
Navigate to the Azure Github release page https://github.com/Azure/azure-powershell/releases
Scroll down until you find the latest Assets chevron that contains an Az-Cmdlets-x.x.x-x64.msi file.
Download and install the MSI.
Relaunch Powershell and you should be good to go.
Upvotes: 2
Reputation: 3923
Your best option here is to start from scratch:
Launch PS as admin and update NuGet to latest version:
Install-PackageProvider -Name NuGet -Force -Scope AllUsers
In the same window install latest version of PackageProvider:
Install-Module -Name PackageManagement -Scope AllUsers -Force -AllowClobber
In the same window install latest version of PowerShellGet
Install-Module -Name PowerShellGet -Scope AllUsers -Force -AllowClobber
Install Azure
Install-Module -Name Az -Scope CurrentUser -Force -Allowclobber
Upvotes: 0