Skip to main content

The NuGet Package Manager Console provides a PowerShell interface within Visual Studio on Windows to interact with NuGet through specific commands.

# To install the latest version of the Elmah package, from the current package source, into the default project:
Install-Package Elmah

# To install version 1.0.0 of Glimpse into the project named MvcApplication1:
Install-Package Ninject.Mvc3 -IgnoreDependencies -Source c:\temp\packages

# To install Ninject.Mvc3, but not its dependencies. It looks in the directory, c:\temp\packages to find the package.
Install-Package Ninject.Mvc3 -IgnoreDependencies -Source c:\temp\packages

# To update a particular package in a project to the latest version:
Update-Package jQuery -ProjectName MyProject

# To update a particular package in a project to the latest version, using safe update rule:
# The `-Safe` flag constrains upgrades to only versions with the same Major and Minor version component.
Update-Package jQuery -ProjectName MyProject -Safe

# To update a particular package in a project to a particular version:
Update-Package jQuery -ProjectName MyProject -Version 1.8

# To update a particular package in all projects of the current solution to the latest version:
Update-Package jQuery

# To update a particular package in all projects of the current solution to a particular version:
Update-Package jQuery -version 1.8

# To reinstall a particular package in all projects of the current solution:
Update-Package jQuery -reinstall

# To update all packages in a project to the latest versions:
Update-Package -ProjectName MyProject

# To reinstall all packages in a project:
Update-Package -ProjectName MyProject -reinstall

# To update all packages in all projects of the current solution to the latest versions:
Update-Package

# To reinstall all packages in all projects of the current solution:
Update-Package -Reinstall

# To remove/uninstall the "elmah" package:
Uninstall-Package elmah