I have a custom PowerShell runspace from which I execute a script (simplified):
Pipeline pipeline = myRunSpace.CreatePipeline(@'c:\temp\Myscript.ps1'); Collection<PSObject> results = pipeLine.Invoke();
In the script I do:
# c:\temp\MyScript.ps1 notepad.exe
Now the Invoke() returns when notepad is closed.
Is there a way to start an app, keep the app running but finishing the script code?
In the script you can do