PowerShell / PowerShell/PSResourceGet
PSResourceInfo object does not properly sort versions
@anamnavi is already working on this.
Since Nov 15, 2021.
- Dominant language
- C#
- Stars
- 576
- Forks
- 114
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 7
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.