-
Notifications
You must be signed in to change notification settings - Fork 684
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
[Question] BaGet as PowerShell module repository #427
Comments
Right now we have the same issue |
@loic-sharma: We really need this to be fixed π Is there any way to help? - Maybe we could provide additional analysis data of specific test scenarios? |
BUMP. @loic-sharma: Any updates about this? |
Hi, I apologize for the very long response. This requires supporting the legacy NuGet V2 APIs, which is tracked by #43. @Mizipzor and @jgagnaire made good progress on this (see #294 and #178). I'll admit that I've been dragging my feet here as I feel torn on adding "legacy" APIs to BaGet. However, I believe that supporting Powershell modules and fully replacing NuGet.Server's feature set feels valuable enough. I will tackle this as part of BaGet V1 soon. |
It's worth pointing out that PowerShellGet v3 is already in progres and doesn't intend to remain fully backward compatible @loic-sharma -- perhaps (assuming it uses the new v3 APIs, since they're commiting to using NuGet.Client) PowerShell is not a good enough reason to re-implement old APIs ... |
Especially when powershell core is out and fully incompatible ;) new name: pwsh ! Includes SSH client !!! |
@softlion except that PowerShell Core is backward compatible, and still ships the same old (v2) NuGet-based PowerShellGet dependency manager, so it doesn't change anything in this regard... |
So If I get this right, the problem could be fixed when:
|
I have tried to install PowerShellGet v3 (Beta 4) and my results were not that encouraging π’
I've tried several different URL's, none of them really work. Am I missing something? |
Hello everyone π I work on the PowerShell team and wanted to say a couple things:
It would be awesome to see the addition of the last couple of v2 APIs to get Find/Install working π |
I got it to install the module using PowershellGet v3.0.0-beta10
|
@brajjan, I see you got it to work with PowerShell Core using DSC. Did it also work for I tried BaGet and LiGet. Was getting the issues on both, but I didn't make the issues over here, yet:
|
@VertigoRay there's no frontend for that one is there? |
@TylerLeonhardt, you are correct. The meta and downloads are available though. I imagine something could be made relatively easy. $module = 'ActiveDiretory'
$url = "https://simple-nuget-server.contoso.com/FindPackagesById()?id=%27${module}%27&$skip=0&$top=40
(Invoke-RestMethod $url)[0].properties.DownloadCount.'#text' I would prefer to not fork that project. I would rather put time into this one. I just need to have time to do that. π |
PowershellGet v3.0.0-beta10 seems to be working fine. # Install latest prelease version of PowershellGet
Install-Module -Name PowerShellGet -AllowPrerelease -Force
# Register BaGet repository
Register-PSResourceRepository -Name 'BaGet' -Url 'http://127.0.0.1:5555/v3/index.json' -Trusted
# Publish resource
Publish-PSResource -Path E:\PowerShell\PSCalendar -Repository BaGet
# Find module
Find-PSResource PSCalendar -Repository BaGet
# Install module
Install-PSResource PSCalendar -Repository BaGet
# Run module function
Show-Calendar |
Hello, |
@MS-LUF I've ran a couple of tests and I can confirm that using TLS this is not working on Beta 10 atm. (We have BaGet deployed on a linux kubernetes cluster with an NGINX front-end proxy.) Once a new version of |
Might be worth getting an issue going on PowerShellGet? |
Already done :) It's a shame that in 2020 a web component does not support TLS ! Moreover, TLS is supported for default repository (PSGallery). I don't understand why they have splitted the behavior in their code... |
Hosting a private NuGet service for Powershell is was a hell in 2021. The problem here isn't the server part at all. Every time I had to connect a new client to the NuGet based service it scared the shit out of me because:
|
@OCram85 The issues you describe are very distinct.
Hope this clarifies a few things. |
You're absolutely right. My comment wasn't really clear and much more impulsive than it was intended. Just wanted to describe the situation I'm facing in a heterogen environment with:
I've invested weeks in the last years to get these systems hooked up with a private NutGet Server like PowershellGallery (BaGet, Nexus Repository....). In some cases it works instant and others you end up reading PowerShellGet and PackageManagement issues / workarounds. So to sum up I just want to tell my personal opinion about this situation: I really like working and developing modules for pwsh. But If you need to deploy your modules internally you're really faced π |
The following worked for me. It can be a workaround/ solution depending on your requirements: Download the Nuget client from the following URL. Nuget client is a .exe file. It does not need any installation, not does it need admin rights to execute. https://learn.microsoft.com/en-us/nuget/install-nuget-client-tools?tabs=windows#install-nugetexe Then, open a PS window with the folder where nuget.exe was downloaded. Run the following command to add BaGet as a source for NuGet client (nuget.exe). .\nuget sources Add -Name "BaGet" -Source "http://localhost:5000/v3/index.json" If the source BaGet has already been added, then run the following command to configure it's settings. (Optional) .\nuget sources Update -Name "BaGet" -Source "http://localhost:5000/v3/index.json" Use the following commands to push packages to Baget. These packages are downloaded in the form of .nupkg file from the PowerShell Gallery. The -ApiKey parameter is the value set in appsettings.json for the ApiKey. .\nuget push -Source BaGet -ApiKey SuperSecret packagemanagement.1.4.8.1.nupkg .\nuget push -Source BaGet -ApiKey SuperSecret powerstig.4.20.0.nupkg .\nuget push -Source BaGet -ApiKey SuperSecret get-windowsautopilotinfo.3.9.0.nupkg Run the following command to install the package on local machine (where you access the BaGet webpage from). This works on Windows. It can possibly work on Linux as well with the equivalent of NuGet.exe for the linux world. .\nuget install < < name of the package > > -Source BaGet .\nuget install get-windowsautopilotinfo -Source BaGet Then, navigate to the directory where the package (PS module) was installed. If you are installing it for -Scope CurrentUser, the directory would be: "C:\users< < username > >\documents\windowspowershell\modules\ < < name of the PS Module > > ". Now the .psm1 file needs to be imported. Run the following command to do so. You may also browse to the module location with Windows Explorer and look for the name of .psm1 file. Usually, it is the same as the module name. In some cases, you many need to import .psd1 file as well, for the PS module to work. import-module < <Path to the .psm1 file> > import-module .\powerstig.4.20.0.psm1 Run the following command to see the newly added PS cmdlets from the installed module(s). The following is a link to Nuget CLI documentation. |
For what it's worth... After all these years, the new version (named PSResourceGet) has finally released with support for the v3 feed format. It might be worth testing with that (and opening an issue on the new repo if it doesn't work) π Also, about the compatibility thing... Although backward compatibility is obviously never trivial, writing PowerShell modules that work across multiple versions back to Windows PowerShell (5.1) and on Windows, Linux and OSX is not that hard -- and PSResourceGet for instance, should work across them all. |
β Question
Did anyone managed to run BaGet as PowerShell module repository sucessfully?
π Details
It seems like there are several discussions about the usage of BaGet and PowerShell in general.
Especially finding and installing packages via PowerShell (PackageManagement & PowerShellGet) seems to be unstable.
BaGet would be the first PackageRespository type using NuGet v3 API. Could the issues relate to this?
π£ Testing Details
2.0.4
1.2.4
πΌ Screenshots
π Refs
The text was updated successfully, but these errors were encountered: