When upgrading our 2008 R2 servers to WMF 5.1 just about all of them have an issue registering the repository for the PSGallery. If I run Get-PSRepository after upgrading, I get the following:
PS C:> Get-PSRepository
WARNING: MSG:UnableToDownload «https://go.microsoft.com/fwlink/?LinkID=627338&clcid=0x409» «»
WARNING: Unable to find module repositories.
I can browse to https://go.microsoft.com/fwlink/?LinkID=627338&clcid=0x409 on the server with IE just fine though.
There is also no way for me to register any new repositories. If I try it tells me I need a Nuget provider. When I try to install that, it fails as well. I get the following when I try to register a new repository:
PS C:> Register-PSRepository -Name ‘Dev’ -SourceLocation $psRepositoryPath -InstallationPolicy Trusted
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\mcelreathma\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:7405 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
- CategoryInfo : InvalidArgument: (Microsoft.Power…PackageProvider:InstallPackageProvider) [Install-Pac
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.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:7415 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
- CategoryInfo : ObjectNotFound: (Microsoft.Power…PackageProvider:GetPackageProvider) [Get-PackageProvi
Register-PSRepository : 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
- Register-PSRepository -Name ‘Dev’ -SourceLocation $psRepositoryPath - …
-
+ CategoryInfo : InvalidOperation: (:) [Register-PSRepository], InvalidOperationException + FullyQualifiedErrorId : CouldNotInstallNuGetProvider,Register-PSRepository
Most of the time I can manually uninstall WMF 5.1, reboot, then reinstall and everything works. There have been a handful of cases where re-installing does not fix the issue at all so we have some servers that cannot use a PSRepository.
Has anyone seen this before? Or would anyone be able to point me in the right direction to start?