KBI 311920 Unable To Install PowerShell Modules And The NuGet Provider
Version
Argent Omega – All Versions
Date
Friday, 26 Mar 2021
Summary
This KBI describes installing the PowerShell prerequisites for Argent Omega.
Customers may find Windows Server failed to install any PowerShell module, for example
Technical Background
Installing PowerShell modules requires the following components to be installed on a Windows Server.
Due to complicated dependencies, the installation sequence below must be followed:
1. Microsoft .NET Framework 4.5 or above
2. PowerShell 5.1 or above
3. PowerShell NuGet Provider
Installation of .NET Framework 4.5 is straightforward; it is not covered in this Argent KBI.
Find PowerShell Version
PowerShell 5.1 is not out-of-the-box for Windows Server 2012 R2 and below.
Use the following command to confirm PowerShell version that is installed.
Get-Host | Select-Object Version
Confirm Transport Layer Security Protocols
PowerShell 5.1 enables SSL 3.0 and TLS 1.0 for secure HTTP connections by default.
But TLS 1.2 is required to install the NuGet Provider.
The following command confirms secure HTTP connection protocols.
[Net.ServicePointManager]::SecurityProtocol
Enable TLS 1.2 for .NET Framework (x64 and x86)
Ensure TLS 1.2 is enabled for both 32-bit and 64-bit .NET Framework.
ButMake a new and full registry backup before editing.
Use this command to set strong cryptography on 64-bit .Net Framework (version 4 and above).
Set-ItemProperty -Path ‘HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NetFramework\v4.0.30319’ -Name ‘SchUseStrongCrypto’ -Value ‘1’ -Type DWord
Use this command to set strong cryptography on 32-bit .Net Framework (version 4 and above).
Set-ItemProperty -Path ‘HKLM:\SOFTWARE\Microsoft\.NetFramework\v4.0.30319’ -Name ‘SchUseStrongCrypto’ -Value ‘1’ -Type DWord
Unfortunately Microsoft demands a reboot of the server to enabling TLS 1.2
After the reboot, confirm Transport Layer Security has been updated to TLS 1.2 protocols.
The following command confirms secure HTTP connection protocols.
[Net.ServicePointManager]::SecurityProtocol
Retry installing PowerShell module or modules, for example the “PartnerCenter” module.
If the NuGet Provider is not installed, it will prompt for installation. Click Yes to accept it.
If the NuGet Provider is correctly installed, the following will be shown:
Upon completing the NuGet Provider installation, a prompt appears for module installation.
Click “Yes to All” to continue.
Installation will proceed, as below:
When the “PartnerCenter” module installation completes, the following is shown:
Resolution
N/A