I need to launch an .exe file from a PowerShell script and wait for the execution to complete.
write-host "I am going to install" c:\mydir\mysetup.exe write-host "Installation terminated"
How can I force the message "Installation terminated" to appear only after mysetup.exe is complete?
Try using Start-Process. The return object gives you a method you can use to wait for the process to terminate.
You must be logged in to reply to this topic.