Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install-Module for PSScriptAnalyzer Occasionally failing for version 1.23.0 #2051

Open
bzhu94 opened this issue Jan 13, 2025 · 0 comments
Open

Comments

@bzhu94
Copy link

bzhu94 commented Jan 13, 2025

Steps to reproduce

Run the command

Install-Module -Name PSScriptAnalyzer -RequiredVersion 1.23.0 -Force -Scope CurrentUser

Expected behavior

The PSScriptAnalyzer module should install without issue.

Actual behavior

Occasionally I'm hitting the following exception (occurs roughly 1 out of every 20 times):

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

If an unexpected error was thrown then please report the full error details using e.g. $error[0] | Select-Object *

Environment data

> $PSVersionTable

TBD - need to get this info injected into our build pipeline where we're seeing this issue (not really an issue seen locally)

> (Get-Module -ListAvailable PSScriptAnalyzer).Version | ForEach-Object { $_.ToString() }

N/A (module hasn't been installed yet)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant