i have a powershell script that runs some installation tasks. it also reads a config file that can contain references to other executables, batch files or powershell scripts to run. basically, the intent is to allow individual users to add additional functionality to the primary script through the config file.
for executables and batch files, the current code works fine. i have something like...
however, this does not work well will powershell scripts, especially if the script also takes parameters. in situations where the name of the script is unknown prior to runtime and will be held in a string variable, is there a simple way to execute the script (and wait for it to complete)?
thanks,
glenn
for executables and batch files, the current code works fine. i have something like...
Code:
$taskItem = [Diagnostics.Process]::Start($exeName, $commandLine);
$taskItem.WaitForExit();
however, this does not work well will powershell scripts, especially if the script also takes parameters. in situations where the name of the script is unknown prior to runtime and will be held in a string variable, is there a simple way to execute the script (and wait for it to complete)?
thanks,
glenn