Calling PowerShell script From External Tool
I am calling a small PowerShell script from the SOATest External Tool function. I am using this to update the passwords for a large number Active Directory test user accounts. The test will generate a new password, run the PowerShell script, update a SQL Server database table, and then update a KeePass repository. The PowerShell script is working but will occasionally fail. The problem is that when the script fails, I want to stop the test.
I searched the forum for PowerShell suggestions but did not find anything about my situation. I realize this may be more about PowerShell than SOATest but I also tried searching the web for information about return codes from script but did not find them helpful.
Thanks for any ideas.
Comments
-
Some quick feedback:
The External Tool has an "Exit value indicates success" option which can make the test fail on non-zero exit code.
You can configure a test scenario to automatically abort from "Test Suite > Execution Options > Test Execution > Tests run as group > Abort scenario on > Any error".
0 -
Thanks benken_parasoft!
I do have that setting at Any error. I think I need to get my PowerShell script to return a nonzero code when the script fails. This is my first shot at PowerShell so I think I need to refine my code a little.0