How to cause pipeline build to error when running Invoke-DatabaseTests

scott1060scott1060 Posts: 12 Bronze 1
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 RJessica R Posts: 1,319 Rose Gold 4
    Hi @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!

    Jessica Ramos | Product Support Engineer | Redgate Software

    Have you visited our Help Center?


Answers

Sign In or Register to comment.