PowerShell / PowerShell/PSResourceGet

Inconsistent Version parameter behavior

Open
#695 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area-Docs Issue-Documentation
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

There seems to be two types of behavior for the Version parameter when accepting a version range.

Any version matching the range criteria has the action performed:

  • Find-PSResource
  • Get-PSResource
  • Uninstall-PSResource

Only the highest version matching the range criteria is used:

  • Install-PSResource
  • Update-PSResource
  • Save-PSResource

This could lead to some confusion with the different behaviors for version ranges when the various commands. In NuGet the version range only returns the highest version that matches the range. I don't know the best resolution for this issue is but it might just need to be documentation or a bit more.

Here are some ideas:

  • Update Find-PSResource to only return the highest version for a given version range to match install, update, and save. Then add a switch parameter to return all versions that meet the version range.
  • Change Get-PSResource and Uninstall-PSResource to not accept ranges or just document the behavior difference in help.
Expected behavior
See description
Actual behavior
See description
Error details

No response

Environment data
Name          Version
----          -------
PowerShellGet 3.0.14

Name                           Value
----                           -----
PSVersion                      7.2.5
PSEdition                      Core
GitCommitId                    7.2.5
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the Version range behavior of Find-PSResource, Get-PSResource, Uninstall-PSResource, Install-PSResource, Update-PSResource, and Save-PSResource. Review how NuGet handles version ranges and determine whether the agreed resolution is consistent command behavior or documentation; done means the behavior or help text clearly matches that decision.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.