Skip to content
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

Questions about Get-PackageProvider vs Install-PackageProvider #182

Closed
CMCDragonkai opened this issue May 24, 2016 · 7 comments
Closed

Questions about Get-PackageProvider vs Install-PackageProvider #182

CMCDragonkai opened this issue May 24, 2016 · 7 comments

Comments

@CMCDragonkai
Copy link

CMCDragonkai commented May 24, 2016

I found you can install Chocolatey using:

Get-PackageProvider -Name chocolatey -ForceBootstrap

But you can also use:

Install-PackageProvider -Name chocolatey

What's the difference?

Also the 2nd command requires you to install nuget, but the first doesn't ask to install nuget?

Also after nuget is installed as a package provider, when I check Get-PackageSource, it doesn't list nuget at all, there's only PowerShellGet and Chocolatey? How come nuget doesn't have its own package source?


As a side question, will there ever be Upgrade-Package or equivalent? Also if I install something like Firefox from Chocolatey, I can't exactly uninstall it from Chocolatey, I need to first uninstall it normally, then finally remove it from Chocolatey. Oneget has this same problem right?

@quoctruong
Copy link

Hi @CMCDragonkai, both cmdlets actually do the same thing. They bootstrap chocolatey provider to your box. Initially, we didn't implement the "Install-PackageProvider" cmdlet, so we provide the -ForceBootStrap switch so user can bootstrap the provider. If you can, please use the "Install-PackageProvider" instead of -ForceBootStrap switch since you can provide other options to the "Install-PackageProvider" cmdlet such as -RequiredVersion (to install a specific version of the provider).

NuGet does not have a default package source. You would have to register one using "Register-PackageSource". An example is "Register-PackageSource -Name nuget.org -ProviderName NuGet -Location https://www.nuget.org/api/v2/"

@CMCDragonkai
Copy link
Author

CMCDragonkai commented May 25, 2016

Ok I see that Install-PackageProvider supersedes the Get-PackageProvider -ForceBootstrap, but why does the new installation require nuget first? What does it do? Just manage manage versions of package providers? If it does install Nuget as a provider itself, why not also register the package source https://www.nuget.org/api/v2/ by default too?

@CMCDragonkai
Copy link
Author

CMCDragonkai commented May 25, 2016

If I'm using chocolatey provider, is it possible to pass Chocolatey install parameters into Install-Package command? The choco install command itself allows extra package flags and options: https://github.com/chocolatey/choco/wiki/CommandsInstall

Better yet, is it possible to access the choco commands directly through OneGet?

@quoctruong
Copy link

Hi @CMCDragonkai, Install-PackageProvider uses Find-PackageProvider first to check for package providers. Find-PackageProvider also uses PowerShellGet to search for providers on PowerShellGallery and NuGet is required for PowerShellGet to work, that is why there is a prompt for installation of NuGet provider.

The Chocolatey provider under OneGet project is only a prototype as a proof of concept and Microsoft internal team does not maintain it. Please send your chocolatey provider request directly to the community. In this case, Rob Reynolds is developing the chocolatey provider: https://github.com/chocolatey/chocolatey-oneget

@CMCDragonkai
Copy link
Author

I see thanks for answering these questions.

I tried your suggested command Register-PackageSource -Name nuget.org -ProviderName NuGet -Location https://www.nuget.org/api/v2/. It worked but I noticed that running Get-PackageSource, that the Nuget source unlike chocolatey or PSGallery had its IsValidated field True. What does this mean?

What does the IsTrusted mean too?

@quoctruong
Copy link

If a source has IsTrusted set to true, then when you install a package from that source, you won't be prompted. If a source has IsValidated set to true, then it means the provider has validated this source.

Please understand that these fields are set by providers and so OneGet has no control over how they are set.

@jianyunt
Copy link
Contributor

jianyunt commented Jun 7, 2016

Free feel to re-open it or open a new issue if you have other questions. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants