0

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

Ash
  • 41
  • 1
  • 1
  • 10

1 Answers1

0

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
Scepticalist
  • 3,737
  • 1
  • 13
  • 30
  • This went fine. Thanks a lot for this piece of instructions. As per **https://learn.microsoft.com/en-us/virtualization/windowscontainers/quick-start/set-up-environment?tabs=Windows-Server#prerequisites** I have to restart the machine. I will restart this when other users sign out tonight. I will get back to you tomorrow morning about the status if Docker is working or not. – Ash May 11 '21 at 13:28
  • Can I ask what does the above 3 lines of code do to Windows Server? – Ash May 11 '21 at 13:31
  • It uses the system proxy settings for the commands that follow. PowerShell has a weird quirk in that some commands use the system proxy and some don't. Some commands have a `-Proxy` switch you can specify but many don't – Scepticalist May 11 '21 at 17:35
  • Thanks for the advise. Docker started but gave a timeout for pull request. I guess it should be something with firewall. I will do some research on that internally. – Ash May 12 '21 at 09:11