PowerShell / PowerShell/PSResourceGet

Give actual reason why module of specified version could not be installed when it was not found

Open
#1,752 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area-ErrorHandling Area-Install feature_request
Dominant language
C#
Stars
576
Forks
114
Avg merge
1d 2h
Merged PRs (30d)
7

Description

Summary of the new feature / enhancement

Windows 11 24H2
PowerShell x64 v7.4.6
Microsoft.PowerShell.PSResourceGet v1.0.6

PS > Install-PSresource -Repository 'PSGallery' -TrustRepository -Scope 'CurrentUser' -Name 'Az.Accounts' -Version '99.98.97'

Install-PSResource: Package(s) 'Az.Accounts' could not be installed from repository 'PSGallery'.

PS >

It'd be great is PSResourceGet to output the actual reason for why Az.Accounts v99.98.97 could not be installed: That this version was not found in the given repository.

Find-PSResource returns this information, Save-PSResource and Install-PSResource should too.

PS > Find-PSResource -Repository 'PSGallery' -Name 'Az.Accounts' -Version '99.98.97'

Find-PSResource: Package with name 'Az.Accounts', version '99.98.97' could not be found in repository 'PSGallery'.

PS >
Proposed technical implementation details (optional)

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the Install-PSResource and Save-PSResource cases with a package version that does not exist, then compare their errors with Find-PSResource. Trace the command implementations and error handling for these entry points; done means both commands report that the requested package version was not found in the specified repository.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, powershell
Domain
cli, tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.