The native command processor doesn't correctly kill child processes (only the parent) when Stop()/BeginStop() is called:
build createchildprocess from test\tools\CreateChildProcess
$cmd = "pathto\createchildprocess.exe"
$ps = [powershell]::create().Addcommand($cmd)
$ps.AddParameter(2) # this creates two children
$ps.BeginInvoke()
# verify that 3 instances of createchildprocess has started
$ps.Stop()
Expected:
parent and child process to be killed
Actual:
parent is killed and children are orphaned (they will eventually timeout and exit)
Repros on PS5.1, PSCore 6.0 Windows/Linux
Name Value
---- -----
PSVersion 5.1.14931.1000
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.14931.1000
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
The native command processor doesn't correctly kill child processes (only the parent) when Stop()/BeginStop() is called:
build createchildprocess from test\tools\CreateChildProcess
Expected:
parent and child process to be killed
Actual:
parent is killed and children are orphaned (they will eventually timeout and exit)
Repros on PS5.1, PSCore 6.0 Windows/Linux