I need to do the following in a PowerShell script:
- call this command:
npm run build - return the exit code of the
npm run buildcommand from my script to the parent (caller) script - print text output of the command
npm run buildbut avoid returning the text from my script
So far I tried:
@Null = @(npm run build)
return $?
this hides the output completely
Write-Host @(npm run build)
return $?
this prints the output without new lines. Additionally, this prints the output all at once, after npm run build, and not gradually
I have PowerShell Version 7