PowerShell / PowerShell/PSResourceGet

PSResourceInfo object does not properly sort versions

Abierto
#459 5 comentarios 0 reacciones 1 asignado Ver en GitHub

@anamnavi ya está trabajando en esto.

Desde el 15/11/2021.

Issue-Bug
Lenguaje dominante
C#
Estrellas
576
Forks
114
Merge medio
1 d 2 h
PR fusionados (30 d)
7

Descripción

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

I should be able to sort resources by their version but this does not work as expected. This does not work due to PowerShellGet 3.0.11-beta splitting up semantic versioning into two different properties Version [System.Version] and PrereleaseLabel [String] on the PSResourceInfo type.

PowerShellGet 3.0.11-beta already takes a dependency on Nuget.Versioning.dll which contains [NuGet.Versioning.NuGetVersion] type that can handle traditional [Version] as well as [SemanticVersion].

Related issue https://github.com/PowerShell/PowerShell/issues/2983, https://github.com/PowerShell/PowerShellGet/issues/83

cc: @jaykul

Expected behavior
Should be able to properly sort resources by version.
Actual behavior
Sorting does not take into account semantic versioning.
Error details

No response

Environment data
PS C:\> Get-Module -Name PowerShellGet

ModuleType Version    PreRelease Name                                ExportedCommands
---------- -------    ---------- ----                                ----------------
Binary     3.0.11     beta       PowerShellGet                       {Find-PSResource, Get-InstalledPSResource, Get-PS…

PS C:\> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.2.0-preview.8
PSEdition                      Core
GitCommitId                    7.2.0-preview.8
OS                             Microsoft Windows 10.0.19043
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0
Visuals

No response

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.