Powershell Gallery slowness: `Install-Module -Name Az` takes 60 minutes instead of 3
Hi ππ½
Seems the PowerShell Gallery is very slow today! Didn't know where to report it other than here :)
Operations which take in a normal situation 3 minutes take now 60 minutes, see log file below:
Thank you for reporting. We are having a look.
I'll second this. Also experiencing this issue.
We had some issues with CDN and now believe the slowness has been fixed, please let us know if this is not the case anymore.
This looks like it used to be, thanks for the fix! π
Reopened, as it seems to recur..! It's kinda on and off again, ranging from the normal 3 minutes to 20 minutes.
Yes the issue is still present this morning.
Hi @aristosvo, @pucciniplagiarist thanks for reaching out. We are aware of this and the Gallery CDN availability should have stabilized by now. We are investigating into the root cause of this. You can follow the status of the gallery at this link: https://github.com/PowerShell/PowerShellGallery/blob/master/psgallery_status.md
@anamnavi I don't know how it's possible, but our downloads are still taking 15-20 minutes instead of 3 previously..
Just over an hour ago: Install-Module -Name Az -Scope CurrentUser -Repository PSGallery -Force
Elapsed time: 0:40:28.8844
@aristosvo - can you please reopen the issue ? It is happening with us as well !
@anamnavi - saw the status page, it shows that the CDN issue is resolved, but its not.
@gautamdsheth I canβt, sorry! You can open a new one if you want to!!
We're working on a more long term fix for this since it's a long term issue. I re-opened the issue.
I noticed on a fresh Windows 2019 build that it was extremely slow also but after upgrading key packages, installing ALL PowerShell Modules were significantly faster.
I was able to install the AZ Module in ~5 minutes after updating the relevant PowerShell packages.
Via Chocolatey, it took less than 30 seconds to download and install all the AZ Modules. YMMV
I found 3 different solutions:
1. Update PowerShell Packages/Modules (Works for All PowerShellGallery Module Installs)
To check versions of installed modules:
Get-Module -ListAvailable
or
Get-Module -Name PowerShellGet
To update the relevant packages:
Write-Output ==^> Install latest NuGet
Install-PackageProvider NuGet -Force
Write-Output ==^> Set PowerShell Gallery to Trusted
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
Write-Output ==^> Install latest PowerShellGet
# *PowerShellGet* also updates its dependency *PackageManagement*
Install-Module PowerShellGet -Force
Write-Output ==^> Install latest PSReadLine
Install-Module PSReadLine -Force
2. Install Azure PowerShell Module via MSI Package
You need to find the AZ release version you want to install and download it.
- GitHub Repo for MSI - https://github.com/Azure/azure-powershell
- Releases Page - https://github.com/Azure/azure-powershell/releases
- 6.2.1 Release: https://github.com/Azure/azure-powershell/releases/tag/v6.2.1-July2021 (look under Assets)
- 6.2.1 MSI Download Link: https://github.com/Azure/azure-powershell/releases/download/v6.2.1-July2021/Az-Cmdlets-6.2.1.34515-x64.msi
3. Install Azure PowerShell Module via Chocolatey
- Azure PowerShell Chocolatey Package - https://community.chocolatey.org/packages/az.powershell
choco install az.powershellchoco install az.powershell --version=5.9.0(If you need a specific version)
Still having issues with this today. Do we have any timeline on this? Thanks.
Facing this on our side too. 20 minutes to install Az.Accounts (5.x megabytes) :(
This slowness is an issue for me today.
Experiencing extreme slowness as well
We are experiencing the same thing, which is a problem when using managed dependencies with Azure Functions. The download of managed dependencies from psgallery doesn't complete before the function execution timeout is reached.
We're working on a long term solution for this. We've had consistent issues with our database connection pools maxing out, we've restarted our instances to reset the connection pools and this should provide a temporary solution. We'll continue to restart our instances if/when this issue arises so that there's minimal interruption until we have our permanent fix.
Running into issues with this today using Azure Functions managed dependencies, it times out while downloading modules and causes the function to fail.
@alerickson It's really horrible at the moment π’
Edit: It takes over an hour to get Az, if we get it at all! Can you give us a workaround, is there a mirror we can use or something?
Same here today, extremely slow
Same here
Same here :(
Still extremely slow. Is there any solution in the pipeline? This problem has existed for months.

Having the horrible performance issues now as well. Given this is backed by Microsoft, is this not using Azure auto scale features to avoid such problems???
It's been really bad as of late. Any plans for improvements? Since version 7.0.0, I now download and install through the released bundle from github:
PSAz=$(curl -sL https://api.github.com/repos/Azure/azure-powershell/releases/latest | jq -r '.assets[].browser_download_url | select(. | endswith(".tar.gz"))')
mkdir -p /tmp/azcmdlets
curl -Lso /tmp/azcmdlets/az.tar.gz $PSAz
tar -xzf /tmp/azcmdlets/az.tar.gz -C /tmp/azcmdlets
pwsh /tmp/azcmdlets/InstallModule.ps1
@monken Thanks for sharing your workaround. I also use it now.
Hello, is there any progress on this issue ? Has been quite bad nowadays. Took 50 mins today

We have the same issue when trying to install the Az module in hosted jobs running on windows-latest (still Windows Server 2019 so far) in Azure pipelines. Seems downloading it from github instead as @monken suggested makes it a lot more reliable so we'll be using that workaround at least until there is a resolution here.