Closed HarelM closed 6 years ago
If you don't specify a source, find-package will only search the package repositories which have already been registered. As the error suggests, Get-PackageSource will show what sources are known about.
You can run
Register-PackageSource -Name nuget.org -Location https://www.nuget.org/api/v2 -ProviderName NuGet
to add nuget.org to the list of package sources. After that,
find-package -name IsraelHiking.GPSBabel
will work as expected.
Can this be configured by default? Unless NuGet is not part of the Microsoft ecosystem... As a side note, I really don't understand why you chose to make this so complex...
@HarelM Once you run Register-PackageSource, it will be persistent every time you launch PowerShell console. It needs to be run once only.
I guess the reason we made so complex possibly due to: 1) The PackageManagement was designed to be an aggregator/dispatcher for its plus-ins (called Package Managers), including PowerShellGet, NuGet, MSI, MSU, Programs, ChocolateyGet, etc. The software installation techniques for the above mentioned are so different. And we tried to simplify it. With the PackageManagement, a user only needs to learn a list of PowerShell cmdlets, find-package, install-package, get-package, register-packagesource, unregister-packagesource, etc for different kinds of software installation. 2) If by default, we registered all these repos, we could make the end user experience simpler as they did not need to figure out package sources and register them, etc. However some users may only need PowerShellGallery.com, while others may only care about NuGet.org. They do not want the PackageManagement reach out different package sources where a user is not aware of. In addition, it can hurt software performance too.
We thought it is good idea to let a user control where their package sources from.
The bottom line is that the user experience around this tool is more complex than it should be - I think a good user experience for package manager can be seen in linux systems where you don't need to configure anything but just add packages. I'm guessing I'm not the only one who got confused by this behavior. Good defaults are key to good user experience, I think you should consider what is the use case you want to solve - letting the user choose (in this case a user who uses this for the first time) can lead to unwanted bahvior and frustration - instead, allow the advanced user to remove source that does not interest him is probably a better UX, IMHO...
Hi, I'm looking into migrating my site to docker and making ti cross-platform. To do so I've searched for the equivalent of linux's
apt-get
orapk add
and found this solution. First of all I would like to congratulate you for getting to a package manager for windows (which was missing for at least a decade, but better late than sorry...). I'm running the following command to try and understand how this works: As far as I'm concerned, as a user, both command lines are valid and should work. Please don't over complicate things...