PSGallery Windows Server 2016

If you should have problems installing packages from PSGallery on your Windows Server installation try the following:

Open a PowerShell session as administrator:

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

Unregister-PSRepository -Name "PSGallery"

Register-PSRepository -Default -Verbose

Set-PSRepository -Name "PSGallery" -InstallationPolicy Trusted