Closed LaurentDardenne closed 1 year ago
This bug and the default behavior involves fixing both types of research (stable version and prerelease version).
In fact during the development of the next version (6.0) I intended to limit the result of the parameter 'modules-to-cache' to stable versions (which is already the case) and to limit the result of the parameter 'modules-to-cache-prerelease' to the prerelease version ONLY. Find-Module -AllowPrerelease returns the latest stable version OR the latest prerelease, this query returns the latest published version. To know the latest prerelease version, you must retrieve all versions (-AllVersions) then filter on the AdditionalMetadata.IsPrerelease property. As this can be penalizing I leave the default behavior, namely that of Find-Module.
In addition for a local repository (Share) property management, isLatestVersion, IsPrerelease, isAbsoluteLatestVersion is wrong.
The contents of the repositories used for the tests:
In this case (module duplication) the result is false, we get a version that is not a prerelease:
A bug in PowershellGet forces you to specify the -AllowPrerelease -AllVersions parameters when calling Find-Module, then to filter on the AdditionalMetadata.IsPrerelease property (of type string).Who will encounter this problem? Nobody or very few people, but even if it means coding as much as doing it correctly ( as much as possible :-) )Edit : this is by design,we must filter the result on the AdditionalMetadata.IsPrerelease property