Forum Discussion

AnneTheAgile's avatar
AnneTheAgile
Contributor
10 years ago
Solved

cannot capture return code from command line in powershell OR batch

I have two trivial tests. zTdd1_Good provides green, passing. zTdd2_Fail provides a very simple red, failure. They both appear to work great, with the small exception that the script at the end of 2_F...
  • HKosova's avatar
    10 years ago
    It should work when using Start-Process ... -PassThru -Wait:



    PS C:\Users\helen> $tc = Start-Process 'C:\Program Files (x86)\SmartBear\TestComplete 10\Bin\TestComplete.exe' '"C:\Users\Public\Documents\TestComplete 10 Samples\Common\Test Log\TestLog.pjs" /run /exit' -PassThru -Wait



    PS C:\Users\helen> $tc.ExitCode

    2



    Sorry I can't be more specific, I don't know PowerShell well.