Closed LaurentDardenne closed 1 year ago
@LaurentDardenne was this working with any previous versions of the module? Also we were looking at the docs for your repo and it looks like v3 endpoints are supported, this may work better as its possible our v2 queries are different on the PS Gallery...thanks for testing this out and reporting such a detailed issue 😄
was this working with any previous versions of the module?
This works with the version 0.5.23 :
Also we were looking at the docs for your repo and it looks like v3 endpoints are supported, this may work better as its possible our v2 queries are different on the PS Gallery
Is it now better to configure repositories with apiVersion 'v3' (if possible)?
@LaurentDardenne thanks for reporting this! This previously worked with 0.5.23-beta23 because we were error handling for V2 server protocol repositories a bit differently...now we check for the <count>
property in the response (and if the count is 0 we write a "Package not found" error), however in the response we get from CloudSmith server it says this property is not yet implemented for them. I will fix this to at least write a better error.
We noticed in their docs that they support V3 NuGet server. So you could register your repository with that server protocol version (v3) support.
Register-PSResourceRepository -Name "CloudSmithv3" -Uri "https://nuget.cloudsmith.io/repopsresourceget/test/v3/index.json"
Find-PSResource -Name "Depends" -Repository CloudSmithv3
This worked for me.
Is it now better to configure repositories with apiVersion 'v3' (if possible)?
I think it's a good idea to see which server protocol your repository can support (by looking at the docs) and try with PSResourceGet. In this case, CloudSmith supports both V2 server and V3 server protocol. Unfortunately with them not having implemented the <count>
property V2 server support won't work with PSResourceGet. So I tried V3 server support and it worked with PSResourceGet. I will make a note of this in our docs for repository support.
So I tried V3 server support and it worked with PSResourceGet.
Effectively, but I have another problem:
C:\temp> $m=Find-PSResource -Name "Depends" -Repository RepoTestV3 -IncludeDependencies
WARNING: Installing dependencies is not currently supported for V3 server protocol repositories. The package
will be installed without installing dependencies.
C:\temp> $m.Dependencies.count
0
For a migration from 'PowerShellGet' to 'PSResourceGet' my first idea is to reuse the existing one (nuget v2), I thought the new version of 'PSResourceGet' was backward compatible.
Prerequisites
Steps to reproduce
Note :
Expected behavior
Actual behavior
Error details
Environment data
Visuals
Register
Call api REST
Call Find-PsResource