Package ‘MSOnline’ Failed to Download

In order to run Easy365Manager your computer needs to have the MSOnline PowerShell module installed.

You can install the MSOnline PowerShell module by executing the following command in an administrative PowerShell prompt:

  1. Install-Module MSOnline

In some cases this command will generate the following error message:

WARNING: Source Location 'https://www.powershellgallery.com/api/v2/package/MSOnline/1.1.183.57' is not valid.
PackageManagement\Install-Package : Package 'MSOnline' failed to download.
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:1772 char:21
+ ...          $null = PackageManagement\Install-Package @PSBoundParameters
+                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ResourceUnavailable: (C:\Users\adm.ad...\MSOnline.nupkg:String) [Install-Package], Exception
    + FullyQualifiedErrorId : PackageFailedInstallOrDownload,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage

To solve this issue enable TLS1.2 by running the following command:

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

The Install-Module command should be working after this.

Did you like this post? Maybe your friends will too!