I am have a powershell script that does a few things that all need to be completed sequentially. Currently I am using this code to run a couple external programs (assume I am in the correct directory)
.\program1.exe
.\program2.exe
.\program3.exe
The problem I am having is that these will all run sequentially, not waiting until the previous one is finished. Is there a way to make them wait until the previous program ends?
Most processes will cause PowerShell to wait until their completion unless they do something funky, like Oracle’s installers.
You could try:
Start-Process -FilePath program1.exe -WaitIf this doesn’t work you might have do something like this: