You may want to occasionally restart a single-instance process. However, shutting down a process does not necessarily mean it is killed in that second. You may have to wait for the shutdown process to complete before you can restart the application. In PowerShell v.2, Wait-Process can do just that. The following line will re-launch Notepad once you close it:
If you'd like to receive some notification once a process has fully shut down, try this:
Note that in V1, you need to add Write-Host:
Or even this:
(New-Object -COM SAPI.SpVoice).Speak('Ok, the sucker is down!')