PowerShell / PowerShell/PSResourceGet
`Save-PSResource` fails when targeting Artifactory with `-Version` (`NormalizedVersion` issue)
Open
@alerickson is already working on this.
Since Aug 27, 2024.
Area-Save
Needs-Triage
- 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
- Attach PSResourceGet to Artifactory repository
- Publish module to repository with
Publish-PSResource - Save the published module with
Save-PSResource, specifying the version of the module with-Version
Expected behavior
PS> Save-PSResource -Name MyModule -Version 0.10.2
PS> # No error
Actual behavior
PS> Save-PSResource -Name MyModule -Version 0.10.2
Save-PSResource: Package(s) 'MyModule' could not be installed from repository 'Artifactory'.
PS>
Error details
N/A
Environment data
ModuleType Version PreRelease Name ExportedCommands
---------- ------- ---------- ---- ----------------
Binary 1.0.5 Microsoft.PowerShell.PSResourceGet {Find-PSResource, Get-InstalledPSResource, Get-PSResourceRepository, Get-PSScriptFileInfo…}
Name Value
---- -----
PSVersion 7.4.4
PSEdition Core
GitCommitId 7.4.4
OS Microsoft Windows 10.0.19045
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Visuals
Running with -Verbose suggests that PSRG is using NormalizedVersion in $filter on a call to FindPackagesById(). Because Artifactory doesn't calculate this property for packages hosted on the service itself, the call returns no results and Save-PSResource fails.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.