Search notes:

System.Diagnostics.Process - WaitForExit()

PowerShell example

$proc           = new-object System.Diagnostics.Process
$proc.StartInfo = new-object System.Diagnostics.ProcessStartInfo

$proc.StartInfo.FileName  = 'notepad'
$proc.StartInfo.Arguments = "$home\email.txt"

$proc.Start()
$proc.WaitForExit()

$proc.ExitCode

Index