Skip to content

Save-PSResource doesn't install the correct version. #1657

@ADD-Izan-Garcia

Description

@ADD-Izan-Garcia

Prerequisites

Steps to reproduce

I am experiencing a problem with Save-PSResource. When installing a specific version of a module from a NuGet server, it doesn't take the one specified.
Steps to reproduce:

  1. Have one powershell module in a NuGet server with two different versions published, like '2024.5.20.1' and 2024.5.20.12'
  2. Download the module with the cmdlet:
Save-PSResource -Name ExampleModule -Version [2024.5.20.1] -Repository ExampleRepository -Path  C:\Users\ExampleUser\Documents -SkipDependencyCheck

Expected behavior

ExampleModule installed in:
C:\Users\ExampleUser\Documents\ExampleModule\2024.5.20.1\ExampleModule.psd1
C:\Users\ExampleUser\Documents\ExampleModule\2024.5.20.1\ExampleModule.psm1 

Inside the ExampleModule.psd1, the field ModuleVersion with the correct version, in this case '2024.5.20.1'

Actual behavior

ExampleModule installed in:
C:\Users\ExampleUser\Documents\ExampleModule\2024.5.20.1\ExampleModule.psd1
C:\Users\ExampleUser\Documents\ExampleModule\2024.5.20.1\ExampleModule.psm1 

Inside the ExampleModule.psd1, the field ModuleVersion with an incorrect version, in this case '2024.5.20.12'

Error details

No response

Environment data

PSVersion 7.4.2
PSEdition Core
GitCommitId 7.4.2
OS Microsoft Windows 10.0.20348
Platfor Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0....}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0

Visuals

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions