|
inconsistent behavior In powershell console, I typed "calc", then "windows caculator"
appear, then powershell immediately returned and I could type other
commands, though "windows caculator" are still running.
But if I wrote the following code in VS, I must manually close
"windows caculator" first, the Main function return.
So, why the behaviors are inconsistent?
using ....
namespace Host3 {
class Program {
static void Test2() {
Runspace runspace = RunspaceFactory.CreateRunspace();
runspace.Open();
Pipeline pipeline = runspace.CreatePipeline("calc");
pipeline.Invoke();
runspace.Close();
}
static void Main(string[] args) {
Test2();
}
}
} |