> nuget
nuget : The term 'nuget' is not recognized as the name of a cmdlet, function, script file, or operable program. ...
> find-package -name nuget | Install-package -verbose
VERBOSE: Skipping installed package NuGet 1.3.3.
> nuget
nuget : The term 'nuget' is not recognized as the name of a cmdlet, function, script file, or operable program. ...
If it is installed, where is it installed? I searched across the drive and no other copies of nuget.exe
exist except for the one I manually installed (but which is obviously not in the $PATH so surely it is not referring to that - I renamed it to double-check!).
I had an expectation from my Java experience and it seems like I was asking the wrong question.
My use case is below. Background first.
dotnet
cli.MSBuild
and makes use of .targets
filesMy use case is to run a build using defined (NOT PRE-DOWNLOADED) dependencies and on a server that has no expectation about the build environment apart from some key tools. Visual Studio is an IDE and I don't expect to find this on a server.
I have created dependencies in a packages.config
file. I want to add nuget.exe
to the build script (currently a build.bat
but a powershell equivalent is preferred).
I know there is a lot of information out there, but with my lack of knowledge in this area tied to the fact that what I want to do is rooted somewhere around 2012 (I'm guessing), I'm not sure what to do.
Given what I do know, I thought all I wanted to do is:
nuget
at the start of the build.bat / build.ps1
scriptnuget
to install the defined dependencies
nuget
manually, run nuget restore
and confirmed that it does what I wantThe first attempt at asking this question was to address #1 from this list. I thought powershell could be used to download nuget.exe
and then the build script could call nuget restore
.
If it is installed, where is it installed?
Assuming you are on a Windows machine, PowerShell packages are usually installed in C:\Program Files\WindowsPowerShell\Modules
(global) or C:\Users\%USERNAME%\Documents\WindowsPowerShell\Modules
(CurrentUser).
nuget.exe specifically is installed - yeah, just where you install it; quoting from NuGet CLI Reference (MSDocs):
Installing nuget.exe
- On Mac and Linux, install Mono 4.4.2 or later.
- Visit nuget.org/downloads and select the version of NuGet you want.
- Each download is the
nuget.exe
file directly. Instruct your browser to save the file to a folder of your choice. The file is not an installer; running it from the browser won't show anything.- Add the folder where you placed
nuget.exe
to your PATH environment variable to use the CLI tool from anywhere.
This seems somewhat confusing, doesn't it? Keep in mind that there are 3 different packages/applications:
Install-Package
Install-Package
cmdlet)