I'm starting a new process like this:
$p = Start-Process -FilePath $pathToExe -ArgumentList $argumentList -NoNewWindow -PassThru -Wait
if ($p.ExitCode -ne 0)
{
Write-Host = "Failed..."
return
}
And my executable prints a lot to console. Is is possible to not show output from my exe?
I tried to add -RedirectStandardOutput $null
flag but it didn't work because RedirectStandardOutput
doesn't accept null
. I also tried to add | Out-Null
to the Start-Process
function call - didn't work. Is it possible to hide output of the exe that I call in Start-Process
?