I have an NPM command that I am running from PowerShell:
npm install process-migrator -g
process-migrator
This command returns an error when its not configured properly, but I cant seam to pick it up in PowerShell.
[ERROR] [2018-09-25T15:30:30.610Z] Cannot find configuration file 'configuration.json'
[INFORMATION] [2018-09-25T15:30:30.615Z] Generated configuration file as 'configuration.json', please fill in required information and retry.
Is there some way to get the error?
I have tried:
if($?) {
Write-Host "Process-Migrator completed sucessfully." $LASTEXITCODE
} else {
Write-VstsTaskError "Process-Migrator FAILED " $LASTEXITCODE -ErrCode $LASTEXITCODE
}
Process-Migrator completed sucessfully. 1
But $? is returning true and $LASTEXITCODE is a 1.