We use Citrix for a lot of applications, and I have a need to launch Outlook, then an application, and then close Outlook when that application is closed by the user. This seems like a pretty simple thing to do (and I suppose it is, sort of) but it took me a while to figure it out.
One piece of the puzzle is that PowerShell remains open if you do it the way I have it setup right now. If the user closes that PowerShell window, then the monitor process will not close Outlook when the user exits the LOB app. In order to mitigate this issue somewhat, I wanted to start PowerShell minimized. The way to do this is:
powershell -WindowStyle Minimized .\ScriptToRun.ps1
Simple but useful. Thanks!