How can I load the nuget powershell commands into a powershell window

Apr 5, 2011 at 7:28 PM

I'd like to run the Nuget power shell commands in a powershell window without having to bring up the VS and running them through the Package Console.  I have the path to the .psm1 file, but can't get it imported into powershell.  Can somebody tell me how to do this?



Apr 5, 2011 at 7:30 PM
Edited Apr 5, 2011 at 7:30 PM

You can't. The cmdlets as they are written right now depend on Visual Studio. 

What are you trying to achieve?

Jul 13, 2012 at 11:24 AM

I know this is an old question, but here is a usecase that I've run into. I've got a package that I have to build different versions of depending on the underlying .NET base library. So during my build, I want to query nuget to get all the versions that are up there, and then run a build job for each of them. So, I've written a powershell script that uses the "nuget" command line to list the packages, and then based on that fires off a specially configured build. This works fine - the powershell commandlets just fit better with this. :-)

Jun 26, 2013 at 1:23 AM
I'd love to see this as well...

Our scenario is:
Using Mercurial, we have three repositories for each product/library. We have three NuGet galleries running (dev, test, prod). The packages get pushed with the same names, but may have different versions.

As we move changesets from Development to Test, we also want to utilize the packages in Test. This is being done now by writing down which packages are installed, uninstalled the packages, and reinstalling the packages of the same name from the Test NuGet server.

Ideally, we were looking for something like:
  1. For a given solution file
  2. Catalog the projects/packages
  3. Uninstall all packages
  4. Reinstall using the catalog from (2), and the Test Nuget server (always want latest version, so we really only care about the package IDs)