-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Use NuGet Package Registry for PowerShell Modules #34486
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Jumping in to say I've also run into this issue. Find-Module -Name PWSHTest -Repository Gitea -Verbose
VERBOSE: Suppressed Verbose Repository details, Name = 'Gitea', Location = 'https://gitea.xxx.com/api/packages/audrey/nuget/index.json'; IsTrusted = 'True'; IsRegistered = 'True'.
VERBOSE: Repository details, Name = 'Gitea', Location = 'https://gitea.xxx.com/api/packages/audrey/nuget/index.json'; IsTrusted = 'True'; IsRegistered = 'True'.
VERBOSE: Using the provider 'PowerShellGet' for searching packages.
VERBOSE: Using the specified source names : 'Gitea'.
VERBOSE: Getting the provider object for the PackageManagement Provider 'NuGet'.
VERBOSE: The specified Location is 'https://gitea.xxx.com/api/packages/audrey/nuget/index.json' and PackageManagementProvider is 'NuGet'.
VERBOSE: Retry downloading 'https://gitea.xxx.com/api/packages/audrey/nuget/registration/pwshtest/1.1.json' for '0' more times
VERBOSE: Total package yield:'0' for the specified package 'PWSHTest'.
Find-Package: No match was found for the specified search criteria and module name 'PWSHTest'. Try Get-PSRepository to see all available registered module repositories.
# Error Returned
PackageManagement\Find-Package : No match was found for the specified search criteria and module name 'PWSHTest'. Try
Get-PSRepository to see all available registered module repositories.
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\2.2.5\PSModule.psm1:8879 char:9
+ PackageManagement\Find-Package @PSBoundParameters | Microsoft ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Microsoft.Power...ets.FindPackage:FindPackage) [Find-Package], Exception
+ FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.FindPackage If the latest version of a package ends with .0, the above error is returned. VERBOSE: Suppressed Verbose Repository details, Name = 'Gitea', Location =
'https://gitea.xxx.com/api/packages/audrey/nuget/index.json'; IsTrusted = 'True'; IsRegistered = 'True'.
VERBOSE: Repository details, Name = 'Gitea', Location = 'https://gitea.xxx.com/api/packages/audrey/nuget/index.json'; IsTrusted =
'True'; IsRegistered = 'True'.
VERBOSE: Using the provider 'PowerShellGet' for searching packages.
VERBOSE: Using the specified source names : 'Gitea'.
VERBOSE: Getting the provider object for the PackageManagement Provider 'NuGet'.
VERBOSE: The specified Location is 'https://gitea.xxx.com/api/packages/audrey/nuget/index.json' and PackageManagementProvider is
'NuGet'.
VERBOSE: Total package yield:'0' for the specified package 'PWSHTest'.
# Error Result
PackageManagement\Find-Package : No match was found for the specified search criteria and module name 'PWSHTest'. Try
Get-PSRepository to see all available registered module repositories.
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\2.2.5\PSModule.psm1:8879 char:9
+ PackageManagement\Find-Package @PSBoundParameters | Microsoft ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Microsoft.Power...ets.FindPackage:FindPackage) [Find-Package], Exception
+ FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.FindPackage Interestingly, if I run the same Find-Module cmdlet with an asterisk at the start or end, it works. find-module -name PWSHTest* -Repository Gitea -Verbose
VERBOSE: Suppressed Verbose Repository details, Name = 'Gitea', Location =
'https://gitea.xxx.com/api/packages/audrey/nuget/index.json'; IsTrusted = 'True'; IsRegistered = 'True'.
VERBOSE: Repository details, Name = 'Gitea', Location = 'https://gitea.xxx.com/api/packages/audrey/nuget/index.json'; IsTrusted =
'True'; IsRegistered = 'True'.
VERBOSE: Using the provider 'PowerShellGet' for searching packages.
VERBOSE: Using the specified source names : 'Gitea'.
VERBOSE: Getting the provider object for the PackageManagement Provider 'NuGet'.
VERBOSE: The specified Location is 'https://gitea.xxx.com/api/packages/audrey/nuget/index.json' and PackageManagementProvider is
'NuGet'.
VERBOSE: Total package yield:'0' for the specified package 'PWSHTest*'.
VERBOSE: Searching repository 'https://gitea.xxx.com/api/packages/audrey/nuget/index.json' for 'searchTerm:PWSHTest'.
VERBOSE: Total package yield:'1' for the specified package 'PWSHTest*'.
# Result
Version Name Repository Description
------- ---- ---------- -----------
1.3.0 PWSHTest Gitea Provides helpers for interacting with the MongooseAPI... Note Some of these error logs report different version numbers. This was done intentionally for the purpose of log collection |
Description
Referring to my post in the forum: https://forum.gitea.com/t/nuget-package-registry-for-powershell-modules/11226
My goal is using Gitea as a registry for custom PowerShell modules.
Current behavier
The problem occurs with PowerShell 5.1 on Windows and PowerShell 7 on Windows / Linux
Expected behavier
The NuGet package registry should work as PowerShell module repository.
Steps to reproduce
You can use this code https://github.com/marvint24/PWSHTest to test it.
publishModule.ps1
file like as described in the readmeAfter that you should find the package in gitea.
You can find the PowerShell module with:
But not with:
You cannot install the module with:
Gitea Version
1.23.8
Can you reproduce the bug on the Gitea demo site?
Yes
Log Gist
https://gist.github.com/marvint24/da65ff545a0b207dcd46003aef411be7
Screenshots
Git Version
2.45.2
Operating System
gitea docker image (Alpine 3.20.3)
How are you running Gitea?
I am using a docker compose file like https://docs.gitea.com/installation/install-with-docker
Database
SQLite
The text was updated successfully, but these errors were encountered: