Avik Dey
Avik Dey

Reputation: 11

"Install-PackageProvider ContainerImage -Force" throws error in Windows Server 2016

I ran the command "Install-PackageProvider ContainerImage -Force" in the PowerShell in Administrative mode as a part of the process to install container in Windows Server 2016.

I encountered the following error:

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. Install-PackageProvider : No match was found for the specified search criteria for the provider 'ContainerImage'. The package provider requires 'PackageManagement' and 'Provider' tags. Please check if the specified package has the tags. At line:1 char:1

Also attached is the image The error

Upvotes: 0

Views: 1666

Answers (2)

Ashkan Mehregan
Ashkan Mehregan

Reputation: 46

You get this error because you should add default repository first, try adding it with following command in power shell:

Register-PSRepository -Default

It should work now!

Upvotes: 2

FeDos
FeDos

Reputation: 113

The issue, as I understand it, is that PowerShell by default uses TLS 1.0 for web requests, which will not work in our case. So this needs to be changed. Thankfully, this is an easy change. Just add the following line to your scripts:

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

This will force the use of TLS 1.2 (you can also make it use 1.1 if you want for some reason).

Note though that this will only change it for that PowerShell session, so it will need to be executed for each script you run.

Upvotes: 0

Related Questions