As far as I can tell , NuGet is meant to be installed as a Visual Studio extension :
But what if I need NuGet on a machine that doesn't have VS installed ?
Specifically, I would like to install NuGet via a PowerShell script.
Here's a short PowerShell script to do what you probably expect:
$sourceNugetExe = "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe" $targetNugetExe = "$rootPath\nuget.exe" Invoke-WebRequest $sourceNugetExe -OutFile $targetNugetExe Set-Alias nuget $targetNugetExe -Scope Global -Verbose
Invoke-WebRequest cmdlet arrived with PowerShell v3.0. This article gives the idea.
Without having Visual Studio, you can grab Nuget from: http://nuget.org/nuget.exe
For command-line executions using this, check out: http://docs.nuget.org/docs/reference/command-line-reference
With respect to Powershell, just copy the nuget.exe to the machine. No installation required, just execute it using commands from the above documentation.