How to control jobs in background in an on-premise environment through implementation of design pattern borrowd to Gang of Four (GOF) : https://docs.microsoft.com/en-us/archive/msdn-magazine/2005/july/discovering-the-design-patterns-you-re-already-using-in-net
Rob Pierry in MSDN Magazine Issues (2005 July): "The Gang of Four didn't invent these patterns, but they documented and formalized the good work others had been doing since the beginning of software development."
The GoF has created an opportunity to use the known design patterns in a PowerShell development and has given the opportunity to implement oriented-object-programming in a script development.
As a PowerShell script is in general, a procedural script because it's usually a simple and straight-forward action.
Transform a procedural script into an OOP create a benefit : documentation into the code.
1- In Visual Studio Code IDE, install the GitHub extension
2- In Visual Studio Code IDE, install the PowerShell extension
3- In Visual Studio Code IDE, install the Visual Studio IntelliCode (nice to have !)
4- Exexute the Module PMS1 - ControlJobs.psm1 and pass the mandatory parameters
1- Instanciation of all the rules while all the rules are not used during the execution.