How to pause PowerShell until the external process finished?

By default, if you launch a Win32 process from PowerShell, control returns immediately to the PowerShell and doesn’t wait for the process to terminate.

We can use [diagnostics.process] to start a Window’s batch job (or application) and wait until the job finished/terminated:
$batfile = [diagnostics.process]::Start("D:\Demo\My_Script.bat")
$batfile.WaitForExit()

Then the Powershell script resumes with the next line.