MSBuild ... post-build script MSBuild.
, npm stderr, TFS . , stdout :
npm install 2>&1
, , . npm install PowerShell script script. , , ERR! :
& npm install *>&1 | ForEach-Object {
$obj = $_
if ( $obj -is [System.Management.Automation.ErrorRecord] ) {
$s = $obj.Exception.Message
}
else {
$s = $obj.ToString()
}
if ( $s.Contains('ERR!') ) {
Write-Error $s
}
else {
Write-Output $s
}
}
$LASTEXITCODE = 0
, $LASTEXITCODE , PowerShell npm TFS.