Find-PSResource
Does Not Properly Evaluate/Compare Available Package Versions Against Specified Version
#1782
Labels
Issue-Bug
Something isn't working
Steps to reproduce
Find-PSResource
cmdlet with-Version
param specified that should show all versions from a specific version and above.Find-PSResource VMware.PowerCLI -Version "[6, ]"
Expected behavior
In this example scenario, the output should have produced lines for all versions of PowerCLI from v6.x up through v13.x which is the current. The old
Find-Module
cmdlet with-AllVersions
param reflects this behavior:Actual behavior
Instead we only see lines for the v6.x versions.
We could run the same command again but with the value 10 inside the version string this time, instead of 6, to confirm that there are in fact newer versions available.
Error details
I'm assuming this has something to do with it not properly interpreting or "sorting" the version field. It appears to be sorting in lexicographical order instead of numerical order (so it thinks 10.x is lower than 6.x since 10 starts with a 1) - that's just a guess based on the behavior I've seen but I could be wrong.
Also I would add that the behavior has been reproduced on both WindowsPowerShell (v5.1) as well as PowerShell (v7).
Please let me know if any additional info is needed.
Thanks!
Environment data
Visuals
The text was updated successfully, but these errors were encountered: