Basically what I am trying to do is have a master script. Within that script would be several variables that would hold the contents of other scripts. When run, the master script would create the .ps1 on the fly and insert the contents of the variables to generate several other scripts. Is there a way of doing this? Thanks
$variable1 = 1$variable2 = 2$script1 = "#this is just a example script$variable1 + $variable2"$script1 | out-file c:\scripts\script1.ps1
The above script would take the variables/ints and output a string to a ps1 file. Just schedule or run it everytime you update the variables.