Skip to content

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.

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.

ALI TAJRAN

ALI TAJRAN

ALI TAJRAN is a passionate IT Architect, IT Consultant, and Microsoft Certified Trainer. He started Information Technology at a very young age, and his goal is to teach and inspire others. Read more »

This Post Has 112 Comments

  1. Thanks Ali
    Never remember to enter your site and use your post and return empty-handed 🙂

    Worked for me while struggling with installing PowerCLI

  2. 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

  3. 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!

  4. So much thanks for this wonderful snippet.. That did the trick for me as well..!!

    Lovely articles you have here.!

  5. Was struggling with this for hours and the trick from this article helped, Thank you so much!!

  6. 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?

  7. Actually, moves with registry can be simplified:
    [System.Net.ServicePointManager]::SecurityProtocol = ‘Tls12’

  8. 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.

  9. 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!!

  10. Great post… been having issues getting WIM Witch fully operational.. worked like a charm..thanks for the work and post!!

  11. Good stuff mate honestly don’t know why Microsoft cannot put this information on their sites for Azure installs!

  12. 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

  13. 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.

  14. Wonderful, It worked for me as I had trouble getting Nuget setup while installing Google Cloud.Thanks a lot for this post.

  15. 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 !

    1. 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.

  16. GENIUS. Thank you ! It worked like a charm. All other posts were so hard to read and didnt work. YOU ROCK !

  17. 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… ?

  18. You saved my day. After searching a lot of blogs, I finally found solution on your blog. Thank you.

  19. Asak Ali,

    Jazak Allah!!
    Thank you for the superb info, the above steps worked fine for connecting and getting around the nuget error.

    Sameer

  20. or we can use:
    [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
    in ps session and then reinstall needed module …

    1. 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.

  21. 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?

  22. 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

  23. 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.

    1. 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!

      1. 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.

  24. 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.

  25. 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

    1. 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.

    1. 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.

  26. Hi Ali – this is brilliant – thank you! perfect solution to the problem I was getting. Excellent bit of troubleshooting and knowledge sharing. Much appreciated!

Leave a Reply

Your email address will not be published. Required fields are marked *