Launch a Jenkins JNLP agent with Powershell script

Hello everyone,

I am new to the community and very glad to be here !!

I have a question: we have a Jenkins controller ( 2.370 ) Windows server running on a bare metal. And we created agents , we launch them from a command line with secret stored in the xml file. How can i launch the agents with a Powershell script?

Thanks in advance.

something like

 Start-Process java -ArgumentList '-jar', 'agent.jar' `-RedirectStandardOutput '.\console.out'  -RedirectStandardError '.\console.err' 


Without any details about what you’ve tried, and why what you have doesn’t work, its hard to give info