dockerpowershellrepositorywindows-server-2016powershellget

Get-PSRepository, powershell warning: "Unable to find module repositories" while trying to install Docker in WindowsServer2016


I want to install Docker and so I tried the below command which gave an error

PS C:\Windows\system32> Install-Module -Name DockerMsftProvider PackageManagement\Install-Package : No match was found for the specified search criteria and module name 'DockerMsftProvider'. Try Get-PSRepository to see all available registered module repositories. At C:\Program Files\ WindowsPowerShell\ Modules\ PowerShellGet\ 1.0.0.1\ PSModule .psm1:1772 char:21 $null = PackageManagement\Install-Package @PSBoundParameters CategoryInfo : ObjectNotFound: (Microsoft.Power....InstallPackage:InstallPackage) [Install-Package], Exception + FullyQualifiedErrorId : NoMatchFoundForCriteria, Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage

even Install-Module -Name DockerMsftProvider -Repository PSGallery -Force gave the same error.

I tried the below resources and still its the same. I am not able to register a PSRepository. Only when this is installed I can install Docker in Windows Server. I spent hours to solve this still at 0% progress. Registering the PSRepository (Register-PSRepository -Default -InstallationPolicy Trusted) went fine without any errors but still its not visible.

Any possible help to solve this?

https://copdips.com/2018/05/setting-up-powershell-gallery-and-nuget-gallery-for-powershell.html

WARNING: Unable to find module repositories

Unable to find module providers

https://www.powershellgallery.com/packages/PowerShellGet/2.2.1

https://learn.microsoft.com/en-us/virtualization/windowscontainers/quick-start/set-up-environment?tabs=Windows-Server#prerequisites


Solution

  • Try running this, do you still get an error?

    [System.Net.WebRequest]::DefaultWebProxy = [System.Net.WebRequest]::GetSystemWebProxy()
    [System.Net.WebRequest]::DefaultWebProxy.Credentials = [System.Net.CredentialCache]::DefaultNetworkCredentials
    Install-Module -Name DockerMsftProvider -Scope AllUsers