PowerShell / PowerShell/PSScriptAnalyzer
Install-Module for PSScriptAnalyzer Occasionally failing for version 1.23.0
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 2.2k
- Forks
- 414
- Avg merge
- 13h 1m
- Merged PRs (30d)
- 2
Description
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)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the reported PowerShell Install-Module command for PSScriptAnalyzer 1.23.0 repeatedly, then capture the missing $PSVersionTable data and full error details. Compare successful and failed attempts to determine whether the intermittent PowerShell Gallery download failure is reproducible; done means identifying a reliable cause and a verified installation outcome.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100