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

Update-PSResource complains about not finding packages when multiple repositories are registered #1789

Open
3 tasks done
peetrike opened this issue Feb 7, 2025 · 0 comments

Comments

@peetrike
Copy link

peetrike commented Feb 7, 2025

Prerequisites

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

Steps to reproduce

When updating packages in AllUsers scope, the Update-PSResource cmdlet complains (with ErrorRecord) about not finding packages from repositories. Packages from PSGallery are searched from local repository and vice versa.

When package name is provided, no error messages occur.

The problem does not occur when packages are updated on CurrentUser scope

  • PowerShell 5.1 complains about not finding local packages from PSGallery.
  • PowerShell 7 complains about not finding public packages from local repository.

Expected behavior

Update-PSResource -Scope AllUsers

no error messages

Actual behavior

Update-PSResource -Scope AllUsers
Update-PSResource: Package with name CompletionPredictor could not be found in repository 'LocalRepo'.
. . .

Error details

Exception             :
    Type    : Microsoft.PowerShell.PSResourceGet.UtilClasses.ResourceNotFoundException
    Message : Package with name CompletionPredictor could not be found in repository 'LocalRepo'.
    HResult : -2146233088
TargetObject          : Microsoft.PowerShell.PSResourceGet.Cmdlets.LocalServerAPICalls
CategoryInfo          : ResourceUnavailable: (Microsoft.PowerShel…LocalServerAPICalls:LocalServerAPICalls) [Update-PSRe
source], ResourceNotFoundException
FullyQualifiedErrorId : PackageNotFound,Microsoft.PowerShell.PSResourceGet.Cmdlets.UpdatePSResource
InvocationInfo        :
    MyCommand        : Update-PSResource
    ScriptLineNumber : 1
    OffsetInLine     : 1
    HistoryId        : 38
    Line             : Update-PSResource -Scope AllUsers
    Statement        : Update-PSResource -Scope AllUsers
    PositionMessage  : At line:1 char:1
                       + Update-PSResource -Scope AllUsers
                       + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    InvocationName   : Update-PSResource
    CommandOrigin    : Internal
ScriptStackTrace      : at <ScriptBlock>, <No file>: line 1
PipelineIterationInfo :
      0
      1

Environment data

  • OS: Windows 10
  • PowerShell: 5.1, 7.5.0
  • PSResourceGet: 1.1.0

Visuals

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant