When installing Microsoft PowerShell cmdlets, such as Exchange Online, you may see an error such as:
Invoke-RestMethod: The underlying connection was closed. An unexpected error occurred on a send.
This is due to TLS not set properly on the Operating System.
In a PowerShell window, execute the following command:
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12