1

I am new to Windows powershell. I tried some ad-hoc queries to test the package-providers and their respective providers. So far I managed to install Chocolatey and Nuget.

as shown here

When I try to see the packages available through Nuget, the command does not return anything.

image

I tried the same command (find-package -provider) with Chocolatey, and this time the list of packages available was sucessfully displayed.

What's wrong with Nuget?

3

There is no NuGet option by default when you do a

get-packagesource

By default PSGallery and Chocolatey have package sources. NuGet doesn't.

To add NuGet as a package source, you need to run the below.

register-packagesource -Name NuGet -ProviderName NuGet -location https://www.nuget.org/api/v2/

This will then register the package provider NuGet with a package source. When you run

find-package -provider NuGet

You should see the list of packages available.

https://stackoverflow.com/questions/5693139/what-is-the-url-for-nuget-gallery-to-access-nuget-org-from-vs2010 discusses other api's to use. I tried the v3 one and it didn't work for me. The v2 worked fine.

It is a bit confusing the way it is implemented.

Hope this helps.

Thanks, Tim.

  • The only thing I have to add to this is maybe don't use the Chocolatey prototype provider - wait for the official one to come out. For now it is better to use straight Chocolatey (choco.exe) instead. It even has PowerShell tab completion. – ferventcoder Dec 25 '16 at 5:14
  • Thanks for the answer @TimHaintz ! Unfortunately it didn't work for me :/ The source-package was installed successfully, but the command find-package still doesn't return anything. I am trying to install the sourcepackage using other URLs from the link you provided. I'll keep you posted if it works for me! – Njw96 Dec 25 '16 at 9:48

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.