PowerShell / PowerShellGallery

228 stars 65 forks source link

No Modules Will Update, Source Location is not valid. #88

Closed SOM-Scott closed 4 years ago

SOM-Scott commented 4 years ago

Trying to update my modules I get this error with every one of them, about 10 need updates.

PS C:\WINDOWS\system32> Update-Module -Name ExchangeOnlineManagement -Verbose
VERBOSE: Checking for updates for module 'ExchangeOnlineManagement'.
VERBOSE: Repository details, Name = 'PSGallery', Location = 'https://www.powershellgallery.com/api/v2'; IsTrusted = 'True'; IsRegistered = 'True'.
VERBOSE: Using the provider 'PowerShellGet' for searching packages.
VERBOSE: Using the specified source names : 'PSGallery'.
VERBOSE: Getting the provider object for the PackageManagement Provider 'NuGet'.
VERBOSE: The specified Location is 'https://www.powershellgallery.com/api/v2' and PackageManagementProvider is 'NuGet'.
VERBOSE: Searching repository 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='ExchangeOnlineManagement'' for ''.
VERBOSE: Total package yield:'1' for the specified package 'ExchangeOnlineManagement'.
VERBOSE: Performing the operation "Update-Module" on target "Version '0.3582.0' of module 'ExchangeOnlineManagement', updating to version '0.4368.1'".
VERBOSE: The installation scope is specified to be 'AllUsers'.
VERBOSE: The specified module will be installed in 'C:\Program Files\WindowsPowerShell\Modules'.
VERBOSE: An update for the module 'ExchangeOnlineManagement' was found with version '0.4368.1'.
VERBOSE: The specified Location is 'NuGet' and PackageManagementProvider is 'NuGet'.
VERBOSE: Downloading module 'ExchangeOnlineManagement' with version '0.4368.1' from the repository 'https://www.powershellgallery.com/api/v2'.
VERBOSE: Searching repository 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='ExchangeOnlineManagement'' for ''.
VERBOSE: InstallPackage' - name='ExchangeOnlineManagement', version='0.4368.1',destination='C:\Users\scott.peters\AppData\Local\Temp\528234371'
VERBOSE: DownloadPackage' - name='ExchangeOnlineManagement', version='0.4368.1',destination='C:\Users\scott.peters\AppData\Local\Temp\528234371\ExchangeOnlineManagement.0.4368.1\ExchangeOnlineManagement.0.4368.1.nupkg',
uri='https://www.powershellgallery.com/api/v2/package/ExchangeOnlineManagement/0.4368.1'
VERBOSE: Downloading 'https://www.powershellgallery.com/api/v2/package/ExchangeOnlineManagement/0.4368.1'.
VERBOSE: An error occurred while sending the request.
VERBOSE: Retry downloading 'https://www.powershellgallery.com/api/v2/package/ExchangeOnlineManagement/0.4368.1' for '2' more times
VERBOSE: An error occurred while sending the request.
VERBOSE: Retry downloading 'https://www.powershellgallery.com/api/v2/package/ExchangeOnlineManagement/0.4368.1' for '1' more times
VERBOSE: An error occurred while sending the request.
VERBOSE: Retry downloading 'https://www.powershellgallery.com/api/v2/package/ExchangeOnlineManagement/0.4368.1' for '0' more times
VERBOSE: Downloading package 'ExchangeOnlineManagement' failed, please make sure 'https://www.powershellgallery.com/api/v2/package/ExchangeOnlineManagement/0.4368.1' is accessable.
WARNING: Source Location 'https://www.powershellgallery.com/api/v2/package/ExchangeOnlineManagement/0.4368.1' is not valid.
PackageManagement\Install-Package : Package 'ExchangeOnlineManagement' failed to download.
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\2.2.3\PSModule.psm1:12989 char:20
+ ...           $sid = PackageManagement\Install-Package @PSBoundParameters
+                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ResourceUnavailable: (C:\Users\scott.....0.4368.1.nupkg:String) [Install-Package], Exception
    + FullyQualifiedErrorId : PackageFailedInstallOrDownload,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage
SOM-Scott commented 4 years ago

Ended up resolving the issue, for some reason my computer is [System.Net.ServicePointManager]::SecurityProtocol is set to ssl3 and tls.

## Add TLS 1.2
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol `
    -bor [System.Net.SecurityProtocolType]::Tls12;

Resolved the issue.