PowerShell / PowerShell/PSResourceGet
`Update-PSResource` complains about not finding packages when multiple repositories are registered
Nessuno ha ancora preso questa issue.
- Lingua principale
- C#
- Stelle
- 576
- Fork
- 114
- Merge medio
- 1g 2h
- PR unite (30g)
- 7
Descrizione
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
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Riproduci il problema con Update-PSResource -Scope AllUsers mentre sono registrati più repository, utilizzando gli ambienti PowerShell 5.1 o 7 descritti. Confronta il comportamento quando viene fornito un nome di pacchetto e quando viene aggiornato l'ambito CurrentUser. Il lavoro è completato quando gli aggiornamenti di AllUsers non segnalano più pacchetti mancanti nei repository che non li contengono.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- csharp, powershell
- Ambito
- cli, tooling
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 45/100