What is the best way to get the mailbox database size and available space? Why…
Unable to install NuGet provider for PowerShell
Before installing EXO V2 module, we need to install the PowerShellGet module. The problem is that we are unable to install NuGet provider and a couple of errors are showing. Warning unable to download from URI, unable to download the list of available providers. After the errors, it did not install. In this article, you will learn why this is happening and the solution for installing NuGet provider for PowerShell.
Table of contents
Unable to install NuGet provider for PowerShell
Run PowerShell as administrator. Run the command Install-Module PowershellGet -Force. When asked to install NuGet provider, press Y and follow with Enter.
[PS] C:\>Install-Module PowershellGet -Force
NuGet provider is required to continue
PowerShellGet requires NuGet provider version '2.8.5.201' or newer to interact with NuGet-based repositories. The NuGet provider must be available in 'C:\Program Files\PackageManagement\ProviderAssemblies' or
'C:\Users\administrator.EXOIP\AppData\Local\PackageManagement\ProviderAssemblies'. You can also install the NuGet provider by running 'Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force'. Do you want PowerShellGet to install
and import the NuGet provider now?
[Y] Yes [N] No [S] Suspend [?] Help (default is "Y"): Y
After pressing Y and follow with Enter, the output is giving us the following warnings.
- WARNING: Unable to download from URI.
- WARNING: Unable to download the list of available providers. Check your internet connection.
- Unable to find package provider ‘NuGet’. It may not be imported yet.
WARNING: Unable to download from URI 'https://go.microsoft.com/fwlink/?LinkID=627338&clcid=0x409' to ''.
WARNING: Unable to download the list of available providers. Check your internet connection.
PackageManagement\Install-PackageProvider : No match was found for the specified search criteria for the provider 'NuGet'. The package provider requires 'PackageManagement' and 'Provider' tags. Please check if the specified package has the
tags.
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:7405 char:21
+ ... $null = PackageManagement\Install-PackageProvider -Name $script:N ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (Microsoft.Power...PackageProvider:InstallPackageProvider) [Install-PackageProvider], Exception
+ FullyQualifiedErrorId : NoMatchFoundForProvider,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackageProvider
PackageManagement\Import-PackageProvider : No match was found for the specified search criteria and provider name 'NuGet'. Try 'Get-PackageProvider -ListAvailable' to see if the provider exists on the system.
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:7411 char:21
+ ... $null = PackageManagement\Import-PackageProvider -Name $script:Nu ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (NuGet:String) [Import-PackageProvider], Exception
+ FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.ImportPackageProvider
WARNING: Unable to download from URI 'https://go.microsoft.com/fwlink/?LinkID=627338&clcid=0x409' to ''.
WARNING: Unable to download the list of available providers. Check your internet connection.
PackageManagement\Get-PackageProvider : Unable to find package provider 'NuGet'. It may not be imported yet. Try 'Get-PackageProvider -ListAvailable'.
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:7415 char:30
+ ... tProvider = PackageManagement\Get-PackageProvider -Name $script:NuGet ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Microsoft.Power...PackageProvider:GetPackageProvider) [Get-PackageProvider], Exception
+ FullyQualifiedErrorId : UnknownProviderFromActivatedList,Microsoft.PowerShell.PackageManagement.Cmdlets.GetPackageProvider
Install-Module : NuGet provider is required to interact with NuGet-based repositories. Please ensure that '2.8.5.201' or newer version of NuGet provider is installed.
At line:1 char:1
+ Install-Module PowershellGet -Force
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Install-Module], InvalidOperationException
+ FullyQualifiedErrorId : CouldNotInstallNuGetProvider,Install-Module
Why are we getting this error and what is the solution for unable to install and download NuGet provider?
Find PowerShell version
Find the PowerShell version that is running on the system. We are going to use the Get-Host cmdlet in Windows Server 2016.
[PS] C:\>Get-Host | Select-Object Version
Version
-------
5.1.14393.3471
PowerShell 5.1 enables SSL 3.0 and TLS 1.0 for secure HTTP connections by default. Let’s confirm that with the next step.
Check Transport Layer Security protocols
Check the supported security protocols on the system.
[PS] C:\>[Net.ServicePointManager]::SecurityProtocol
Ssl3, Tls
As we can see, the security protocols defined in the system are SSL 3.0 and TLS 1.0. Both of the security protocols are deprecated.
Transport Layer Security protocols
See a list of the security protocols and when they are published including the current status. At the moment of writing, only TLS 1.2 and TLS 1.3 are approved.
Protocol Published Status
-------- --------- ------
SSL 2.0 1995 Deprecated in 2011
SSL 3.0 1996 Deprecated in 2015
TLS 1.0 1999 Deprecated in 2020
TLS 1.1 2006 Deprecated in 2020
TLS 1.2 2008
TLS 1.3 2018
Solution for unable to install NuGet provider for PowerShell
Now that we gathered all the information, we are going to enable TLS 1.2 on the system. Run both cmdlets to set .NET Framework strong cryptography registry keys. After that, restart PowerShell and check if the security protocol TLS 1.2 is added. As of last, install the PowerShellGet module.
The first cmdlet is to set strong cryptography on 64 bit .Net Framework (version 4 and above).
[PS] C:\>Set-ItemProperty -Path 'HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NetFramework\v4.0.30319' -Name 'SchUseStrongCrypto' -Value '1' -Type DWord
The second cmdlet is to set strong cryptography on 32 bit .Net Framework (version 4 and above).
[PS] C:\>Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\.NetFramework\v4.0.30319' -Name 'SchUseStrongCrypto' -Value '1' -Type DWord
Restart Powershell and check for supported security protocols.
[PS] C:\>[Net.ServicePointManager]::SecurityProtocol
Tls, Tls11, Tls12
Run the command Install-Module PowershellGet -Force and press Y to install NuGet provider, follow with Enter.
[PS] C:\>Install-Module PowershellGet -Force
NuGet provider is required to continue
PowerShellGet requires NuGet provider version '2.8.5.201' or newer to interact with NuGet-based repositories. The NuGet provider must be available in 'C:\Program Files\PackageManagement\ProviderAssemblies' or
'C:\Users\administrator.EXOIP\AppData\Local\PackageManagement\ProviderAssemblies'. You can also install the NuGet provider by running 'Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force'. Do you want PowerShellGet to install
and import the NuGet provider now?
[Y] Yes [N] No [S] Suspend [?] Help (default is "Y"): Y
NuGet provider did download successfully. Did it work for you?
Conclusion
In this article, you learned why you are unable to install NuGet provider for PowerShell. The solution to this problem is configuring TLS1.2 or higher on the system. After that, you can install NuGet for PowerShell. Did you enjoy this article? You may also like Cleanup Exchange logs automatically with scheduled task. Don’t forget to follow us and share this article.
Thank you so much brother!! you are great!!
Thank you. Excellent article resolved the issue.
Thank you for the quick reference.
Thanks Ali
Never remember to enter your site and use your post and return empty-handed 🙂
Worked for me while struggling with installing PowerCLI
Hello Ali,
Thank you for your assistance. Just a quick note, as this took up quite a bit of my time. It’s also advisable to check the proxy settings.
Best regards
Carlos Behlau
Awesome, Exactly what was needed for all Windows Server 2016 servers.
Thank you.
Works like a charm!
This solution saved me soooo much time today. Thank you!
Really Awesome steps worked perfectly..
Vous êtes le meilleur.
Nice clear instructions, worked a treat. THANK YOU
Thank you so much. it worked.
Worked for me, your my savior !
Thank you so much
lovely!
Hi,
Even after confirming Tls12, I still get:
WARNING: Unable to download from URI ‘https://go.microsoft.com/fwlink/?LinkID=627338&clcid=0x409’ to ”.
—-
PS C:\> [Net.ServicePointManager]::SecurityProtocol
SystemDefault
PS C:\> [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
PS C:\> [Net.ServicePointManager]::SecurityProtocol
Tls12
——-
I’m running this from the command line for a Docker Windows container.
Suggestions appreciated – thank you!
Worked Perfectly, thanks so much
Thanks a bunch!
Thank you!
So much thanks for this wonderful snippet.. That did the trick for me as well..!!
Lovely articles you have here.!
I just wanna say thanks!
This resolved the issue in a short notice!
excellent, so many thanks for the concise explanation and remedy
Great Stuff – Worked fine
Great stuff!
It worked. Thanks man ! It was pretty long search for me.
Most excellent.
Thanks! Worked like a charm!
Solved my issue. Kudos.
Did all the steps and more but it’s still not working for me. Help please.
Was struggling with this for hours and the trick from this article helped, Thank you so much!!
Thanks for sharing this info!
Is this command safe to run on SQL SERVER 2016?
I notice both Set-ItemProperty command are hitting AssmlyfoldersEX and SQL Server Assemblies, what will happen to sql server if I run this?
THANK YOU!!!
You are the man!
it worked for me , thanks so much
ton
Worked perfectly, thank you!!
Awesome, thanks
léger ,simple et lourd bravo et merci infiniment.
Perfect, thank you!
Thank you. It solved perfectly my problem 🙂
Actually, moves with registry can be simplified:
[System.Net.ServicePointManager]::SecurityProtocol = ‘Tls12’
I’ve tried all steps mention in process and output of [Net.ServicePointManager]::SecurityProtocol showing as Tls, Tls11, Tls12
I am running this admin and I still could not run command Install-Module PowershellGet -Force
It has same error.
Is there anything else I can do to check what is causing issue.
I am running on Windows Server 2016.
Cheers.
Yet another thanks for you! Thank you for the knowledge!
IT WORKED!!! I COULD KISS YOU!!! :*
Thank you so much! Really helpful.
Obrigado meu amigo, Quase uma semana quebrando a cabeça com isso.
Dude, thanks.
This was very helpful and appreciated.
Many Thanks
Thank you for the knowledge! Much appreciated!
Wonderful!!! I stop to the same error message for hours. Many thanks for your explanation and scripts to help me to install NuGet provider before PowerShellGet installation.
Then I can perform “Install-Module -Name ExchangeOnlineManagement” to Install the Exhange Online PowerShell module successfully.
Many thanks for your efforts!!
Thanks, this really helped!
Thank you, this fixed my issues! Great article.
Great post… been having issues getting WIM Witch fully operational.. worked like a charm..thanks for the work and post!!
Good stuff mate honestly don’t know why Microsoft cannot put this information on their sites for Azure installs!
Thanks, this really helped!
Big Thank YOU!!!!
Really big thanks, you help me alot
I got stuck trying to install Application Insight Status Monitor on windows server.
Wondering why only deprecated protocols are enabled by default on Windows server 2016…
These steps fixed the issue.
You’re the best!
Thanks
Exactly what I needed. Very well explained.
Good looking Ali
Thank you very much !!!
Thanks
Thanks very much, Mr. Tajran for the excellent explanation and walk-through.
Worked perfectly on Win10 LTSB/PS 5.1.
Now it is happily running the PS plugin in VSCode w/ updated package manager.
Thank you. Great solution. It worked perfectly well
thanks for this post.
Hero!
Thanks for this post. This resolved the issue that I had with updating NuGet.
Wonderful, It worked for me as I had trouble getting Nuget setup while installing Google Cloud.Thanks a lot for this post.
I too faced the same issue. Thanks a ton for the author of this post. It worked like a charm!!!
Hello,
At beginning I had :
PS C:\WINDOWS\system32> [net.servicepointmanager]::securityprotocol SystemDefault
Then after trying your trick per-session :
PS C:\WINDOWS\system32> [net.servicepointmanager]::securityprotocol Tls12
Still have an issue to install the module (same error).
Thanks in advance !
Try:
gpupdate /force
and in one line:
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls, [System.Net.SecurityProtocolType]::Tls11,[System.Net.SecurityProtocolType]::Tls12
then check again – helped me.
GENIUS. Thank you ! It worked like a charm. All other posts were so hard to read and didnt work. YOU ROCK !
Tried all the commands, even the per session ones. When I check the security protocols it returns Tls, Tls11, Tls12 and I still get the same error. I noticed that the RegKeys were created in the .NET v4.0.303319 but I also see v4.5.25000. Is there possibility that powershell uses another version of .NET than v4.0.30… ?
You saved my day. After searching a lot of blogs, I finally found solution on your blog. Thank you.
Thanks a lot, you saved my nerves
Asak Ali,
Jazak Allah!!
Thank you for the superb info, the above steps worked fine for connecting and getting around the nuget error.
Sameer
Excellent….tried lot…but finally here i got solution….thanks ALI TAJRAN
Perfect Article ! It worked for me.
Good Job ! 🙂
or we can use:
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
in ps session and then reinstall needed module …
I just logged in to thank you and Ali Tajran .
Ali Tajran tips was not enough, but after your tip, it worked very well.
Thank you guys.
Thanks for that, this worked for me.
Good info, but I still cant install Nuget because PowerShell assumes that you are connected to the Internet. Not all servers are connected to the Internet. This is a stupid prerequisite just to install a PS module. Why is Microsoft requiring this?
upgrade powershell
https://learn.microsoft.com/en-us/powershell/scripting/windows-powershell/install/installing-windows-powershell?view=powershell-7.3#upgrading-existing-windows-powershell
then install nuget and set path in environment
https://learn.microsoft.com/en-us/nuget/install-nuget-client-tools
This is very helpful. Worked for me. Big Thx
Yes it worked for me and thank you very much!!
Yes it is work for me and thank you very much!!
Yes it’s work for me and thank you very much!
THANK YOU! This had been a thorn in my side for some time!!!!
Thanks. I’m having trouble installing the latest version of ML.NET Builder (Beta) and I couldn’t install the Azure PowerShell module that was needed by it. Your post at least let me run the following command after updating PowershellGet per your instructions:
Install-Module -Name Az
Hi, I can see Tls12 but when I execute Install-Module PowershellGet -Force after closing and opening again Powershell ISE i get this message:
WARNING: The version ‘1.4.7’ of module ‘PackageManagement’ is currently in use. Retry the operation after closing the applications.
I cannot install Nuget provider.
Find out if the PowerShell module is already installed on the system. Run PowerShell as administrator and run the following cmdlet:
Get-InstalledModule
Do you see the module PowerShellGet in the Name column? If yes, it means that it’s already installed.
If not, run the following cmdlet:
Install-Module PowerShellGet -RequiredVersion 2.2.4 -SkipPublisherCheck
Let me know the results!
Hi, thank for your answer. The PowerShellGet is already installed, but on the module browser I see NuGet-anycpu.exe is required. The problem still persist, and I’m not able to execute my script due this error:
Exception calling “AcquireToken” with “4” argument(s): “Loading an assembly required for interactive user authentication failed. Make sure assembly
‘Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms,
I think both errors are correlated.
Great job Mate, This worked a treat :). Thanks for Sharing cobber.
Hi Ali,
Many thanks. your solution worked out perfectly for me on getting this dreaded nuget install which was causing me grief. Wish you well.
Thank you very much. It worked
Thanks, It worked out.
Thanks for the help ! Was struggling with this issue for quite some time !
Yes, worked on an old system, thanks alot!
Great job,
it finaly works.
Keep up the great work
Excellent info! This was annoying me for a 2 months…
Thank mate, saved my day!
I have followed same procedure what you mention but still i am facing error
PS C:\> Get-Host | Select-Object Version
Version
——-
5.1.17134.858
PS C:\> [Net.ServicePointManager]::SecurityProtocol
Ssl3, Tls
PS C:\> Set-ItemProperty -Path ‘HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NetFramework\v4.0.30319’ -Name ‘SchUseStrongCrypto’ -Value ‘1’ -Type DWord
PS C:\> Set-ItemProperty -Path ‘HKLM:\SOFTWARE\Microsoft\.NetFramework\v4.0.30319’ -Name ‘SchUseStrongCrypto’ -Value ‘1’ -Type DWord
PS C:\> [Net.ServicePointManager]::SecurityProtocol
Ssl3, Tls
PS C:\> Install-Module PowershellGet -Force
NuGet provider is required to continue
PowerShellGet requires NuGet provider version ‘2.8.5.201’ or newer to interact with NuGet-based repositories. The NuGet
provider must be available in ‘C:\Program Files\PackageManagement\ProviderAssemblies’ or
‘C:\Users\Ram_Vignesh\AppData\Local\PackageManagement\ProviderAssemblies’. You can also install the NuGet provider by
running ‘Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force’. Do you want PowerShellGet to install
and import the NuGet provider now?
[Y] Yes [N] No [S] Suspend [?] Help (default is “Y”): Y
WARNING: Unable to download from URI ‘https://go.microsoft.com/fwlink/?LinkID=627338&clcid=0x409’ to ”.
WARNING: Unable to download the list of available providers. Check your internet connection.
PackageManagement\Install-PackageProvider : No match was found for the specified search criteria for the provider
‘NuGet’. The package provider requires ‘PackageManagement’ and ‘Provider’ tags. Please check if the specified package
has the tags.
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:7468 char:21
+ … $null = PackageManagement\Install-PackageProvider -Name $script:N …
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (Microsoft.Power…PackageProvider:InstallPackageProvider) [Install-Pac
kageProvider], Exception
+ FullyQualifiedErrorId : NoMatchFoundForProvider,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackagePro
vider
PackageManagement\Import-PackageProvider : No match was found for the specified search criteria and provider name
‘NuGet’. Try ‘Get-PackageProvider -ListAvailable’ to see if the provider exists on the system.
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:7474 char:21
+ … $null = PackageManagement\Import-PackageProvider -Name $script:Nu …
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (NuGet:String) [Import-PackageProvider], Exception
+ FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.ImportPackageProv
ider
WARNING: Unable to download from URI ‘https://go.microsoft.com/fwlink/?LinkID=627338&clcid=0x409’ to ”.
WARNING: Unable to download the list of available providers. Check your internet connection.
PackageManagement\Get-PackageProvider : Unable to find package provider ‘NuGet’. It may not be imported yet. Try
‘Get-PackageProvider -ListAvailable’.
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:7478 char:30
+ … tProvider = PackageManagement\Get-PackageProvider -Name $script:NuGet …
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Microsoft.Power…PackageProvider:GetPackageProvider) [Get-PackageProvi
der], Exception
+ FullyQualifiedErrorId : UnknownProviderFromActivatedList,Microsoft.PowerShell.PackageManagement.Cmdlets.GetPacka
geProvider
Install-Module : NuGet provider is required to interact with NuGet-based repositories. Please ensure that ‘2.8.5.201’
or newer version of NuGet provider is installed.
At line:1 char:1
+ Install-Module PowershellGet -Force
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Install-Module], InvalidOperationException
+ FullyQualifiedErrorId : CouldNotInstallNuGetProvider,Install-Module
Did you restart PowerShell after running both the Set-ItemProperty cmdlets?
If you did a restart of PowerShell and it’s still not working, do the following:
Run PowerShell as administrator and run the command:
[Net.ServicePointManager]::SecurityProtocol
What does the above command show you as output?
If it does not show you TLS12, it will not work.
Run the command:
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
This time, don’t close PowerShell as this command is a per-session setting.
Again run the command:
[Net.ServicePointManager]::SecurityProtocol
Does it show you TLS1.2 now? If yes, run the command:
Install-Module PowershellGet -Force
I hope that this worked.
This didn’t work for me. Followed all the steps and it still won’t install NuGet
Run PowerShell as administrator and run the command:
[Net.ServicePointManager]::SecurityProtocol
What does the above command show you as output?
If it does not show you TLS12, it will not work.
Run the command:
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
This time, don’t close PowerShell as this command is a per-session setting.
Again run the command:
[Net.ServicePointManager]::SecurityProtocol
Does it show you TLS1.2 now? If yes, run the command:
Install-Module PowershellGet -Force
I hope that this worked.
Worked perfectly fine.
Great solution, worked perfectly!
Brilliant! it fixes my issue.
THANK YOU
Hi Ali – this is brilliant – thank you! perfect solution to the problem I was getting. Excellent bit of troubleshooting and knowledge sharing. Much appreciated!
Thank you so much. it worked 🙂
Awesome. It worked! Thanks.
Wow. It actually worked
Thank you!
Thank you. Exactly what I needed.
Worked perfectly.