Skip to content

Update-PSResource fails to upgrade same-version prerelease -> full release #1953

Closed

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

  • Find a package where:
    • A prerelease exists
    • A full release was minted with the same version
    • The prerelease and full release (minus prerelease suffix) are the same
      For example, JiraPS has 2.15.0 as latest, but previously had 2.15.0-alpha1.
  • Install the prerelease.
    (I'm explicitly pinning a version here, but pretend that I didn't do that)
    Install-PSResource JiraPS -Version 2.15.0-alpha1 -Prerelease
  • Try to upgrade the prerelease to a full-release:
    Update-PSResource JiraPS -Verbose -Debug
  • Observe that:
    • No update is installed
    • PSRG emits the following log line:
      VERBOSE: Installed package JiraPS 2.15.0 is already up to date.
      
    • Get-Module -ListAvailable shows no changes to installed modules

Expected behavior

Package is updated

Actual behavior

Package is not updated

Error details

No error

Environment data

PS>  Get-Module Microsoft.PowerShell.PSResourceGet; $PSVersionTable | ft

ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Binary     1.1.1      Microsoft.PowerShell.PSResourceGet  {Compress-PSResource, Find-PSResource, Get-InstalledPSResource, Get-PSResourceRepository...}



Name                           Value
----                           -----
PSVersion                      5.1.19041.6456
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.19041.6456
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Visuals

No response

Activity

  1. sean-r-williams commented on Feb 28, 2026

    @sean-r-williams
    ContributorAuthor

    Looking at PSRG under a debugger, I think the following line is the culprit:

    if (!NuGetVersion.TryParse(installedPackage.Version.ToString(), out NuGetVersion installedVersion))

    installedPackage.Version is a System.Version which doesn't have a prerelease string. installedPackage.Prerelease is alpha1, but it doesn't seem like that's being included here. After this line, installedVersion is 2.15.0, not 2.15.0-alpha1.

  2. sean-r-williams commented on Feb 28, 2026

    @sean-r-williams
    ContributorAuthor

    Anam Navied (@anamnavi) - I see you're the owner of most of the test_module PSGallery modules - would you be able to publish another test module with two packages (one prerelease, one not) that have matching version numbers?

    This behavior feels like something that should have a test associated with it. I'm happy to write one, but since it depends on live Gallery packages I'm not sure if 3P contributors should be uploading those modules themselves.

    I can also upload the modules myself if you'd like to manually take ownership of the packages from the Gallery backend. Let me know what's preferred here.

  3. sean-r-williams commented on Mar 19, 2026

    @sean-r-williams
    ContributorAuthor

    Sydney Smith (@SydneyhSmith) Anam Navied (@anamnavi) Checking back in on this as it's been a bit - what are the next steps for getting test modules on the Gallery?

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

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions