Is it possible to catch a PowerShell script output when an exit code is setted?
i'm using TEO 2.1.2 with the hotfixes from 1 to 12 already installed and i have a problem using the "Execute Windows PowerShell Script" in reading the output of a PowerShell script if an exit code is expressly setted . For example if i try to execute a script like:
the output given by the activity is only 0 (like the exit code).
This is a problem if i use a script with multiple exit codes corrisponding to different kind of situations and different outputs like the following:
if($flag -eq "0")
elseif ($flag -eq "1")
Write-output "Error 1"
Write-output "Error 2"
or if i call an executable which exit codes i want to identify by a readable description.
Is it possible to catch a PowerShell script output when an exit
i was already looking toward this kind of approch, but i was also curious if there was a different way of doing this.
Anyway just a little annotation about your line of code, in Tidal 2.1.2 at least, Write-host doesn't work right, echo or Write-Output are fine but Write-host seems to be ignored. To the following script:
the output is
Maybe i'm missing something. Regarding an upgrade, as a devoloper i'd really like to try the improvement of the new version but this is not a decision I can make.