Nuget Restore working while executing on Jenkins server but not while executing on Agent

Hi All,

I am using Jenkins 2.440.1 and this is Jenkins is configures on a windows server.

Under Manage Jenkins → System → Nuget → Nuget Command Line Excutable
Here I have given the path C:\Nugets\nuget.exe

So whenever I am running my test cases on the Build In Node (Jenkins server), to restore nugets I just need to pass “nuget restore” command and it refers to the nuget.exe that I have setup in system settings

But with same setup I am trying to run on my Agent (I have hosted my machine as a Node). To restore nugets I have pass command “C:\Nugets\nuget.exe restore” and I have to save nuget.exe at C:\Nugets or at any other location but the nuget.exe has to be on my local.

While running on my agent I have to specify the nuget.exe path or else it gives error saying Nuget is not a recognized command.

Is there a workaround for this? so that with same configuration it will pass on the agent as well the Jenkins server

@MarkEWaite @halkeye Could you please help me out here?

Set the PATH on the agent to include the directory that contains the nuget.exe executable. Compare the PATH environment variable on the controller with the PATH environment variable on the agent and you’ll likely see that there is a difference.

For Agent The Path is C:\Nugets\nuget.exe
For Controlled The Path is C:\Nugets\nuget.exe

But this two paths are on 2 different machine the agent (my machine) and the controller.

Is there a way to handle this? So that I don’t have to set 2 different paths