I have 6+ scripts and growing to run on a folder, what is the best way to have them run one after the other.
I have seen and tried this thread - it did not work unfortun
The reason why the powershell screen pops up is cuz you dont have the argument -NoExit set. Please use the following as an example to see if your code is running properly:
Start-Process "$pshome\powershell.exe" -ArgumentList "-NoExit", "-Command '& script'" -wait
Sorry for the late response but I also ran into the issue and thats how I was able to resolve it to make sure it was work.
Also I changes the file names as follows:
$Scripts =
@(
".\C:\Scripts\First.ps1"
".\C:\Scripts\Second.ps1"
".\C:\Scripts\Third.ps1"
);