Open VertigoRay opened 3 years ago
I came here with the same issue, although I'm trying to use the v2 api since thats what PS5.1 supports out of the box:
On the liget host (apikey = 123456):
docker run -d -v nuget_data:/data -p 9011:9011 -e "LIGET_API_KEY_HASH=8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92" --name liget tomzo/liget
On the Publisher (powershell 7):
nuget sources add -Name 'liget2' -Source "https://test.tacnet.dev/api/v2/package"
On Windows 2022 Server subscriber:
PS C:\Users\Administrator> Register-PSRepository -InstallationPolicy Trusted -Name liget -SourceLocation https://test.tacnet.dev/api/v2
PS C:\Users\Administrator> Find-Module Certus.Utilities -Repository liget
PackageManagement\Find-Package : No match was found for the specified search criteria and module name 'Certus.Utilities'. Try
Get-PSRepository to see all available registered module repositories.
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:1397 char:3
+ PackageManagement\Find-Package @PSBoundParameters | Microsoft ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Microsoft.Power...ets.FindPackage:FindPackage) [Find-Package], Exception
+ FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.FindPackage
PS C:\Users\Administrator> Install-Module Certus.Utilities -Repository liget
PackageManagement\Install-Package : No match was found for the specified search criteria and module name 'Certus.Utilities'.
Try Get-PSRepository to see all available registered module repositories.
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:1809 char:21
+ ... $null = PackageManagement\Install-Package @PSBoundParameters
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Microsoft.Power....InstallPackage:InstallPackage) [Install-Package], Exception
+ FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage
My solution: https://inedo.com/proget
Using PowerShell 5.1 with PowerShellGet v1.0.0.1 (the default version), I can
Publish-Module
just fine, but when I try toFind-Module ActiveDirectory -Repository liget
, I get the following warning and error:Cannot set the source based on your response to #14. Will get the following warning when you
Register-PSRepository
:It's really odd because you can see at the bottom of that output it says,
DEBUG: 00:00:02.1042394 '1' packages received in the last request.
When I confirm, the output, it does show ActiveDirectory, but the schema is a bit odd. Here's the output fromhttp://192.168.0.201:9011/api/v2/FindPackagesById()?id=%27ActiveDirectory%27&$skip=0&$top=40
:Here's a linted version:
I'm not really sure what the schema expects. I kinda assum you would know since you're developing it. I just wanted to share my experience and provide as much debugging information as I can. I did try sunside's simple-nuget-server, and it does search properly despite other issues we have with that server. Here's XML returned from the same query:
Here's a linted version, and you'll probably notice the additional type metas provided:
Related issue: #39