PowerShell / PowerShell/PSResourceGet

NuGet API v2 `Find-PSResource -Prerelease` does not return prerelease if there is any newer stable release(s)

Aperta
#1,607 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Area-Find feature_request Issue-Discussion
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

PowerShell Gallery / NuGet API v2 Find-PSResource -Prerelease -Name 'Az.Accounts' returns a stable release rather than a prerelease.

I expect this cmdlet to return the newest prerelease version, even if there's newer stable release(s) available.

Observation

Doing Find-PSResource -Name 'Az.Accounts' -Prerelease -Debug tells us that PSResourceGet does a GET to:

Which indeed just returns the absolute newest version, whether it's a prerelease or not.

Workaround

Following URL in my testing returns the newest prerelease, and does not care if newer stable release(s) exsists.

This works if asking for one package Id at a time. Don't know if it's possible to achieve this if asking for multiple Ids in the same request.

Expected behavior
Return newest prerelease version
Actual behavior
Returns absolute latest version, whether it's a prerelease or not.
Error details

No response

Environment data
Not relevant.
Visuals

No response

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia riproducendo Find-PSResource -Prerelease -Name 'Az.Accounts' e analizza le richieste NuGet API v2 documentate nell’issue. Confronta la query IsAbsoluteLatestVersion con il workaround IsPrerelease, Version-descending. Il lavoro è completo quando il comando restituisce la prerelease più recente anche quando esiste una versione stabile più recente, inclusa la conferma del comportamento per i casi di query del package-name supportati.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
csharp, powershell
Ambito
backend, cli
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
38/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.