Closed johlju closed 1 week ago
Use -Verbose
and/or -Debug
(don't remember which) to see what API query against PowerShell Gallery the cmdlet generates. Could be a problem with the PowerShell Gallery, lots of open issues about it in the PowerShell Gallery repo:
Edit:
Find-PSResource -Repository 'PSGallery' -Name 'Pester' -Version '[6.0,7.0)' -Prerelease -Debug
gives URL:
https://www.powershellgallery.com/api/v2/FindPackagesById()?$filter=NormalizedVersion+ge+%276.0.0%27+and+NormalizedVersion+lt+%277.0.9%27+and+Id+eq+%27Pester%27&$inlinecount=allpages&$skip=0&$orderby=NormalizedVersion+desc&id=%27Pester%27
Using the API directly returns four alpha versions:
PS > Invoke-RestMethod -Method 'Get' -Uri 'https://www.powershellgallery.com/api/v2/FindPackagesById()?$filter=NormalizedVersion+ge+%276.0.0%27+and+NormalizedVersion+lt+%277.0.9%27+and+Id+eq+%27Pester%27&$inlinecount=allpages&$skip=0&$orderby=NormalizedVersion+desc&id=%27Pester%27'
id : https://www.powershellgallery.com/api/v2/Packages(Id='Pester',Version='6.0.0-alpha4')
category : category
link : {link, link}
title : title
updated : 2024-07-11T19:05:03Z
author : author
content : content
properties : properties
id : https://www.powershellgallery.com/api/v2/Packages(Id='Pester',Version='6.0.0-alpha3')
category : category
link : {link, link}
title : title
updated : 2024-07-05T13:27:38Z
author : author
content : content
properties : properties
id : https://www.powershellgallery.com/api/v2/Packages(Id='Pester',Version='6.0.0-alpha2')
category : category
link : {link, link}
title : title
updated : 2024-07-01T14:16:32Z
author : author
content : content
properties : properties
id : https://www.powershellgallery.com/api/v2/Packages(Id='Pester',Version='6.0.0-alpha1')
category : category
link : {link, link}
title : title
updated : 2024-07-11T03:34:51Z
author : author
content : content
properties : properties
PS >
So this actually might be a bug with PSResourceGet?
Thanks @johlju nuget version ranges consider an alpha version of 6 to be below 6.0
Prerequisites
Steps to reproduce
This should be reproduced using a module's major version that only has prereleases. That is the current state of Pester v6 for now.
Expected behavior
Actual behavior
Error details
Environment data
Visuals
No response