oneget: Unable to find module providers (PowerShellGet).

System Info:

PS C:\WINDOWS\system32> [environment]::OSVersion.Version
Major  Minor  Build  Revision
-----  -----  -----  --------
10     0      10586  0
PS C:\WINDOWS\system32> $PSVersionTable.PSVersion
Major  Minor  Build  Revision
-----  -----  -----  --------
5      0      10586  122

Error:

PS C:\WINDOWS\system32> Get-PSRepository
PackageManagement\Get-PackageSource : Unable to find module providers (PowerShellGet).
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:3544 char:31
+ ... ckageSources = PackageManagement\Get-PackageSource @PSBoundParameters
+                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (Microsoft.Power...etPackageSource:GetPackageSource) [Get-PackageSource
   ], Exception
    + FullyQualifiedErrorId : UnknownProviders,Microsoft.PowerShell.PackageManagement.Cmdlets.GetPackageSource

The below returns nothing:

PS C:\WINDOWS\system32> Get-PackageProvider -ListAvailable
PS C:\WINDOWS\system32>

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 19

Most upvoted comments

What worked for me was to disable FIPS in regedit and reboot. Then run [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12. Finally, run Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force.

For those who have performed protocol/cipher suite hardening, you can use this on a per-session basis to tell the client to use TLS 1.2 instead:

 [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

Just run that right before your Get-PSRepository or Install-Module 😉

I began encountering problems with executing Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Verbose -Force after SSL/TLS hardening was applied to the server where the command was executing. I had to revert the protocol and ciphers (HKLM\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL) and cipher suite (HKLM\SYSTEM\CurrentControlSet\Control\Cryptography) preferences to default values in order for Install-PackageProvider and the underlying libraries to be able to connect to www.powershellgallery.com.

Before SSL/TLS hardening was backed out, I saw Event ID 36871 in the System log each time I tried to install the NuGet provider. The event text was:

A fatal error occurred while creating a TLS client credential. The internal error state is 10013.

Edit: Further investigation has revealed that the client library being used to fetch repo data is only capable of TLS 1.0, while the host invoking Install-Module was configured to only use TLS 1.2.

Hi @ChrisKapend are you still having this issue with the latest version of PackageManagement? If so what command are you running?

Hi @alerickson thanks for reaching out, after updating NuGet version 3.0.0.1 the error disappears

@nbuuck

Edit: Further investigation has revealed that the client library being used to fetch repo data is only capable of TLS 1.0, while the host invoking Install-Module was configured to only use TLS 1.2.

This is on spot - thanks a lot

I got the same issue for on clean Windows Server 2016 virtual machine. Probably it happened when network was not available.

Get-PSRepository
WARNING: Unable to find module repositories.

Execute the command to fix (solution from http://www.classcastexception.com/2016/04/install-container-support-on-windows.html):

Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Verbose -Force

Then restart PowerShell.

Chocolatey installation should help too.