I have the following in a PowerShell script:
cmd /c npm run build-release
$succeeded = $LastExitCode
What I'd like to do is:
- Pipe the output of the
cmdto a variable so it doesn't write to the host - Only if
$succeedediseq $true,Write-Hostthe output variable from that thecmd
How can this be done?