There are lot of challenges in environment when you use a script and always miss to schedule or park it for later use. Here Jenkins will give you this option to configure once and use everytime. I am used to of using PowerCLI for doing Day 2 Day operational tasks. Everytime I save script in a folder a strugle to find next time when I have same kind of requirement. Even, if my team members want to use the same script and if they don't have scripting skills, they find hard to use any automation. Jenkins help in this scenario as well. You can simply create a task for specific script and your team members have to just click on a button to execute in future. In this blog, I am going to explain the use of Jenkins to run PowerShell Script and fetch the report. Let'se see step by step below.
Click on Create New Jobs.
Give name of Job. Select "Freestyle Project", and Click on OK.
Click on Job and provide description.
Scroll down and goto Build. Click on that and you will find many options. Select PowerShell.
Copy you PowerShell script here. Here I am using small script to create a directory and show host name. Click on Save
Click on Build Now.
Script is running and it will fetch information.
Click on Console Output to see the report.