PSResourceGet icon indicating copy to clipboard operation
PSResourceGet copied to clipboard

[Question] Publish-PsResource and the versioning of a module manifest

Open LaurentDardenne opened this issue 2 years ago • 3 comments

Question

For a local repository Publish-PSResource must it respect the versioning indicated in this doc ?

With Microsoft.PowerShell.PSResourceGet v0.5.23 this is not the case :

Get-PSResourceRepository

Name        Uri                                                      Trusted Priority
----        ---                                                      ------- --------
PSGallery   https://www.powershellgallery.com/api/v2                 False   50
PSRepoLocal file:///C:/Users/Laurent/AppData/Local/Temp/PSRepoLocal/ True    50


Publish-PSResource -Path C:\Temp\Gallery\String\1.1.0.1 -Repository PSRepoLocal -verbose
#ok no error

dir C:\Users\Laurent\AppData\Local\Temp\PSRepoLocal


    Répertoire : C:\Users\Laurent\AppData\Local\Temp\PSRepoLocal


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a----        07/08/2023     13:52          10669 String.1.1.0--beta.nupkg
-a----        07/08/2023     12:17           8885 String.1.1.0-prerelease.nupkg
-a----        07/08/2023     12:18           8889 String.1.1.0.1-prerelease.nupkg

NOTE : If I use Publish-Module and Publish-PSResource for the same local repository, with Install-Module I cannot install modules that do not respect versioning : image

But Find-Module considering in the result the packages which do not respect versioning : image

Proposed technical implementation details (optional)

No response

LaurentDardenne avatar Aug 09 '23 09:08 LaurentDardenne

Thanks @LaurentDardenne could you please share the psd1 you are using as well, we are investigating this...thanks!

SydneyhSmith avatar Aug 15 '23 19:08 SydneyhSmith

The psd1 files : Repro.zip

@SydneyhSmith I did not get an answer to my question :

For a local repository Publish-PSResource must it respect the versioning indicated in this doc ?

In fact, according to the document I quote and the documentation of the version parameter of Find-PSResource, the notion of version seems to me to be different depending on the context.

Note: the file .\String\1.1.0.2\String.psd1 défine the Prerelease key to ' beta'. Which generates an exception : image

LaurentDardenne avatar Aug 16 '23 11:08 LaurentDardenne

One last case: if Prerelease contains '+beta' the error occurs. If Prerelease contains '123+beta' there is no error but item 'version' inside the nuspec file contains '1.2.3-123' :

image

There is an implicit version format transformation.

Manifest-repro.zip

LaurentDardenne avatar Aug 16 '23 13:08 LaurentDardenne