Create a master control script

CroTeam 21 Reputation points
2020-09-17T18:25:09.197+00:00

Hi all,

I saw in one forum that people discussed about master control script that can create new scripts and run. Can someone please provide a link or site where I can learn more.

I would like to create a master script that creates new scripts or if this is not possible to run many scripts. I know that we can call a script within script but what if we have many? How to force the second script to wait for the first one and so on? Primary goal is to create one master.

Here is the discussion:
"Create a script that double and repeats scripts. You know, the Master Control Script.

Sort of. I even was about to create a script that create several ones using variable substitutions and multi-line string variables. I didn't cause I wasn't satisfied with the workload/salary ratio. Luckly I'm in the middle of my notice cause I found another job. My company's loose 🤷‍♂️

Windows for business Windows Server User experience PowerShell
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Rich Matheisen 47,901 Reputation points
    2020-09-17T19:26:03.26+00:00

    So you mean to create files that are PowerShell scripts, or scripts that exist only for the duration of the "Master Control Script" (or until that master control script removes/replaces the variable that contains them), and then run them?

    In both cases, you can use Invoke-Command (with either a file or script block), or Start-Job to achieve this, depending on how you want to mange their execution.

    The bigger question is how you intend to describe what you want your master control script to do! Would you invent a meta-language? You'd then have to write the code that converts that language into PowerShell.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.