Not all of your Jenkins projects will consist of “Hello World” type routines. What if we want to run some PowerShell jobs? Or better yet, PowerCLI? Our Jenkins instance was built on CentOS and doesn’t run Windows PowerShell very well at all. Luckily for us, in situations like this, we can add additional Jenkins nodes and yes they can also be Windows hosts!
Login to your Jenkins Instance and go to Manage Jenkins and then click on Manage Nodes.
You should see the master Jenkins node listed already in the grid. Now click on “New Node” to add another Jenkins Node to the list.
Give the node a name and select “Dumb Slave”.
Add a number of executors and a remote root directory. This controls how many simultaneous tests the new node can run at a time and what directory to be run under. The next item to select is the Launch Method. I’ve chosen to run the Jenkins agent through the Java Web Start. If this is a production instance you probably want to do this by adding a Windows service but this is a lab and is quicker to get up and running. Click Save.
Configuration is done, now you should be able to see a new node in the list, but it’s got a dreary red “X” next to it. Click on the name of the new node.
Here we see some instructions on how to start the agent on the Windows Node. Copy the command from this site.
Open the URL from the windows node and wait for the Jenkins app to open and say “Connected.”
Now if we look at the Jenkins Nodes again, we’ll see that they’re both online and ready to run our tests.
Now we can run both Linux tests as well as Windows tests on our shiny new Jenkins hosts. In the next post we’ll cover how to run a PowerShell script on our Windows machine.