PSResourceGet icon indicating copy to clipboard operation
PSResourceGet copied to clipboard

Update-PSResource version range not working

Open ThomasNieto opened this issue 3 years ago • 0 comments

Prerequisites

  • [X] Write a descriptive title.
  • [X] Make sure you are able to repro it on the latest released version
  • [X] Search the existing issues.

Steps to reproduce

Update-PSResource is not working with version ranges.

Expected behavior

PS C:\> Find-PSResource -Name ComputerManagementDsc -Version '[5.0,6.0)'

Name                  Version Prerelease Repository Description
----                  ------- ---------- ---------- -----------
ComputerManagementDsc 5.2.0.0            PSGallery  The ComputerManagementDsc module is originally part of the Windows…
ComputerManagementDsc 5.1.0.0            PSGallery  The ComputerManagementDsc module is originally part of the Windows…
ComputerManagementDsc 5.0.0.0            PSGallery  The ComputerManagementDsc module is originally part of the Windows…

PS C:\> Install-PSResource -Name ComputerManagementDsc -Version '5.0' -PassThru

Name                  Version Prerelease Repository Description
----                  ------- ---------- ---------- -----------
ComputerManagementDsc 5.0.0.0            PSGallery  The ComputerManagementDsc module is originally part of the Windows…

PS C:\> Update-PSResource -Name ComputerManagementDsc -Version '[5.0,6.0)' -PassThru

Name                  Version Prerelease Repository Description
----                  ------- ---------- ---------- -----------
ComputerManagementDsc 5.2.0.0            PSGallery  The ComputerManagementDsc module is originally part of the Windows…

Actual behavior

PS C:\> Find-PSResource -Name ComputerManagementDsc -Version '[5.0,6.0)'

Name                  Version Prerelease Repository Description
----                  ------- ---------- ---------- -----------
ComputerManagementDsc 5.2.0.0            PSGallery  The ComputerManagementDsc module is originally part of the Windows…
ComputerManagementDsc 5.1.0.0            PSGallery  The ComputerManagementDsc module is originally part of the Windows…
ComputerManagementDsc 5.0.0.0            PSGallery  The ComputerManagementDsc module is originally part of the Windows…

PS C:\> Install-PSResource -Name ComputerManagementDsc -Version '5.0' -PassThru

Name                  Version Prerelease Repository Description
----                  ------- ---------- ---------- -----------
ComputerManagementDsc 5.0.0.0            PSGallery  The ComputerManagementDsc module is originally part of the Windows…

PS C:\> Update-PSResource -Name ComputerManagementDsc -Version '[5.0,6.0)' -PassThru
PS C:\> Get-PSResource -Name ComputerManagementDsc

Name                  Version Prerelease Repository Description
----                  ------- ---------- ---------- -----------
ComputerManagementDsc 5.0.0.0            PSGallery  The ComputerManagementDsc module is originally part of the Windows…

PS C:\> Update-PSResource -Name ComputerManagementDsc -Version '5.2' -PassThru

Name                  Version Prerelease Repository Description
----                  ------- ---------- ---------- -----------
ComputerManagementDsc 5.2.0.0            PSGallery  The ComputerManagementDsc module is originally part of the Windows…

Error details

N/A

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

ThomasNieto avatar Jul 08 '22 01:07 ThomasNieto