Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## display dialogue when a process exits
- ## must be run with PowerShell 7.x as Windows PowerShell doesn't have the required Wait-Process arguments
- ## could use -id instead of -name and -any to wait for a specific process instance that you know the pid of
- date;$null = [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.VisualBasic");$p = $null;$p=Wait-Process -name OfficeClickToRun -any -passthru|? ExitCode -ne $null;[Microsoft.VisualBasic.Interaction]::MsgBox("Started at $($p.StartTime), finished at $($p.ExitTime), exit code $($p.ExitCode)" , 'OKOnly,SystemModal,Exclamation' , "Process $($p.Name) Exited" )
Add Comment
Please, Sign In to add comment