Fix issue with powershell windows exec. need to remove stderr

This commit is contained in:
garnier-quentin 2019-04-08 18:29:29 +02:00
parent a3b47917b6
commit 7d49cf31bc
1 changed files with 5 additions and 2 deletions

View File

@ -55,9 +55,12 @@ sub windows_execute {
$options{output}->option_exit(); $options{output}->option_exit();
}; };
my $job = Win32::Job->new; my $job = Win32::Job->new;
my $stderr = 'NUL';
$stderr = \*TO_PARENT if ($options{output}->is_debug());
if (!($pid = $job->spawn(undef, $cmd, if (!($pid = $job->spawn(undef, $cmd,
{ stdout => \*TO_PARENT, { stdin => 'NUL',
stderr => \*TO_PARENT }))) { stdout => \*TO_PARENT,
stderr => $stderr }))) {
$options{output}->add_option_msg(short_msg => "Internal error: execution issue: $^E"); $options{output}->add_option_msg(short_msg => "Internal error: execution issue: $^E");
$options{output}->option_exit(); $options{output}->option_exit();
} }