Repository navigation
Check NuGet updates against the newest installed version - #5626
Merged
Marc-André Moreau (mamoreau-devolutions) merged 1 commit intoOct 29, 2026
Merged
Marc-André Moreau (mamoreau-devolutions) merged 1 commit into
Marc-André Moreau (mamoreau-devolutions) merged 1 commit into
Conversation
Update-PSResource installs each new version side by side, and Get-InstalledPSResource lists the copies sorted as strings (1.9.0, 1.12.6, 1.10.1). The update check took whichever copy was enumerated last, so a module like XKCD kept reporting 1.10.1 as installed and looked like it never updated, even though every update succeeded. Pick the highest installed version per id for the V2, V3 and local feed update paths, and take the update scope from that same copy. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Marc-André Moreau (mamoreau-devolutions)
merged commit Oct 29, 2026
c6400a4
into
main
8 of 9 checks passed
Marc-André Moreau (mamoreau-devolutions)
deleted the
claude/xkcd-powershell-update-issue-714972
branch
October 29, 2026 11:57
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
A PowerShell 7 module such as
XKCDkeeps showing up in Software Updates with the same installed version, even though every update from UniGetUI succeeds (exit code 0). RunningUpdate-PSResourceoutside UniGetUI behaves as expected.Update-PSResourceinstalls each new version next to the old ones, andGet-InstalledPSResourcelists the copies sorted as strings rather than as versions:The update check took whichever copy was listed last, so it reported
1.10.1as installed after each update. The operation history shows1.10.1 → 1.10.3,1.10.1 → 1.10.5,1.10.1 → 1.11.0and1.10.1 → 1.12.4, all marked as succeeded.Fix
BaseNuGet.SelectNewestInstalledpicks the highest installed version for each package id. When two copies have the same version, the last one listed wins, as before.GetUpdates()), V3 and local folder feed update paths now take the installed version from that copy.KeepUpdatesNewerThanInstalleduses the new helper instead of its own copy of the logic.This covers all the NuGet-based managers: PowerShell, PowerShell 7, .NET Tool and Chocolatey.
Notes for reviewers
BuildV2UpdateUrlsstill sends the oldest installed version on purpose.KeepUpdatesNewerThanInstalledfilters the results.Testing
PowerShell7ManagerTests. One uses XKCD's real listing order and expects1.12.6 → 1.12.7. The other checks that the scope comes from the newest copy.PowerShell7ManagerTests,NuGetV3ManagerTestsandNuGetLocalFeedTestspass onnet10.0andnet10.0-windows.dotnet format(whitespace and style) leaves no changes.1.12.6 → 1.12.7(it had been stuck at1.10.1), and updating it from UniGetUI succeeded.🤖 Generated with Claude Code