SQL Server PowerShell module installation failed with “Unable to download..” error

Today when installing SQLServer module on one system I got the below error.

This happens because the TLS setting for PowerShell is not compatible with PSGallery.

Use the below script to set the session TLS version to 1.2 for the session

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

Once doing this you will be able to install any module but you need to do it every time you are installing any new module.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s