How to cause pipeline build to error when running Invoke-DatabaseTests
I am creating a a CICD pipeline and need to have the build fail when I get a test error. I am using powershell in Gitlab to run the build and Octopus is doing the actual deployment. When I run the build, I can see the error from the test but it is interpreted as a warning and the build continues. How do I get it to fail instead of just a warning?
Tagged:
Best Answer
-
Jessica R Posts: 1,319 Rose Gold 4Hi @scott1060!
I believe you can set the$WarningPreference
variable mentioned on this page so that a warning would stop the process (for example, $WarningPreference = "Stop").
Hope that helps!
Answers