By explaining how to execute windows command, PowerShell scripts through Jenkins, we can start to finish some simple tasks at this time, but you may see that we are all executed by manually pressing the Build Now button.Sometimes we may need to execute some scripts regularly. Jenkins is also supported. Let’s talk about how to use Jenkins to execute timed tasks.
We have created a new FreeStyle Project task named periodicalProject. We don’t know how to create it. Please refer to the previous chapter.
We pull down to the Build Triggers column,
And select the following options
We entered the Schedule
As specified, the representative is executed every two minutes.
For the timing format, I refer to the following blog content.
In the Add Build Step of Build column, we choose the following
And enter the command get-date, then click Save task to complete.
At this point, you do not need to manually build, Jenkins will complete the construction every two minutes. Click #x to enter the task construction record, you can see that PowerShell output the current time.