Using the user command described in the link , you can only run external tools. In your case, you can run the NuGet command-line utility. First, you need to download nuget.exe. Then you need to add the user command, its arguments, and the start directory in the External Tools dialog box. You can use solution variables (e.g. $ (ProjectFileName), $ (SolutionDir)) for the arguments and source fields of the directory. You can use the bat file to run several commands.
Unfortunately, the NuGet command-line utility has fewer features than the package manager console. I do not know if these functions are enough to solve your problem?
To use all the features of NuGet and integrate into Visual Studio, you can implement VSPackage . From VSPackage, you can add a custom command anywhere in Visual Studio (as a button or menu item). When the command starts (the user clicked the button), you can call any NuGet API method inside Visual Studio. This path takes time to develop, and not just.
source share