PowerShellGallery icon indicating copy to clipboard operation
PowerShellGallery copied to clipboard

Ubuntu 20.04.6 LTS from Powershell 7.4.1 can't download any PowerShellGallery module

Open Igor-ABI opened this issue 1 year ago • 2 comments

Prerequisites

  • [X] Write a descriptive title.
  • [X] Make sure you are able to repro it on the latest version
  • [X] Search the existing issues.

Steps to reproduce

From Self-hosted agent for DevOps with Ubuntu 20.04.6 LTS and PowerShell 7.4.1 With root account any module installation process is failing since more than a month, any idea what can be the issue? I applied TLS1.2 mitigation but doesn't do any difference in Ubuntu [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

PS /home/Root_SH> Install-Module -Name Az.Accounts -RequiredVersion 2.17.0

Untrusted repository You are installing the modules from an untrusted repository. If you trust this repository, change its InstallationPolicy value by running the Set-PSRepository cmdlet. Are you sure you want to install the modules from 'PSGallery'? [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "N"): Y WARNING: Source Location 'https://www.powershellgallery.com/api/v2/package/Az.Accounts/2.17.0' is not valid. Install-Package: Package 'Az.Accounts' failed to download.

Expected behavior

Install-Package: Package 'Az.Accounts' COMPLETED

Actual behavior

**WARNING: Source Location 'https://www.powershellgallery.com/api/v2/package/Az.Accounts/2.17.0' is not valid.
Install-Package: Package 'Az.Accounts' failed to download.**

Error details

No response

Environment data

PS /home/Root_SH> $PSVersionTable.PSVersion

Major  Minor  Patch  PreReleaseLabel BuildLabel
-----  -----  -----  --------------- ----------
7      4      1

Version

7.4.1

Visuals

image

Igor-ABI avatar Apr 19 '24 14:04 Igor-ABI

@Igor-ABI what's the response when you run invoke-webrequest "https://www.powershellgallery.com/api/v2/package/Az.Accounts/2.17.0"?

alerickson avatar Apr 23 '24 19:04 alerickson

Thks Alerickson for the answer! looks network related!

OUTPUT of the invoke-webrequest

cmdlet Invoke-WebRequest at command pipeline position 1 Supply values for the following parameters: Uri: https://www.powershellgallery.com/api/v2/package/Az.Accounts/2.17.0 Invoke-WebRequest: Network is unreachable

Igor-ABI avatar Apr 24 '24 13:04 Igor-ABI