Make Install-Module work in Windows Server 2012 R2

By Marc

Sometimes you need to install additional PowerShell modules, e.g. to perform some tasks in Exchange Online. I recently wanted to change some settings there and only had Windows Server 2012 R2 servers to work with. So I tried to install the Exchange Online PowerShell V2 module, but installtion failed, stating that there was no internet connection. I did experience this some times before, where most likely proxy servers or rigid firewalls were causing the issue.

This time, the default settings of Windows Server 2012 R2 prevented PowerShell from accessing the online repository. By default, Windows Server 2012 R2 (and older) only allow TLS 1.0 or SSL3 connections using the .NET Framework (which PowerShell is using). As PSGallery disabled support for TLS 1.0 quiet a while ago, we don’t have any suitable methods of secure communication. To overcome this problem, you need to Enable TLS 1.2 in Windows (that post describes several settings for different scenarios), at least for the .NET Framework 4.0 and higher.

Hope, this helps, took me some time to find the right spot and then found out, that I already blogged about it … *doh*

Loading