Launch an application from PowerShell, running in the user workspace, save the application, end the script?

I have a PowerShell user space from which I am running 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 Invoke()returns when the notebook is closed.

Is there a way to launch the application, save the application, but ending with script code?

+3
source share
1 answer

In a script you can do

[Diagnostics.Process]::Start("notepad.exe")
+6
source

Source: https://habr.com/ru/post/1703064/


All Articles