Kinook Software Forum

Go Back   Kinook Software Forum > Visual Build Professional > [VBP] Third Party Tools
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 09-25-2015, 11:50 AM
paxil paxil is online now
Registered User
 
Join Date: 03-18-2014
Location: Richmond, VA
Posts: 12
Stopping on PowerShell script error

I'm using VBP v8.6:
I am deploying code to an Azure environment by use of a Powershell script. On the Powershell (build step) tab, I have the script radio button selected and my command is like this with the passed in parameters:
C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powersh ell.exe PS_File.ps1 -param1 '%PARAM1%' -param2 '%PARAM2%' etc...

Whats happens is VBP will continue to build this powershell step successfully, but in the build output, I can see errors from the powershell script. How can I capture that error and stop the deployment.

This is the same issue whether I execute it as the "Run Program" or "PowerShell" build steps.

Thanks
GW
Reply With Quote
  #2  
Old 09-25-2015, 12:08 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
You need to write your PowerShell script in such a way that it returns a non-zero exit code on errors.

https://www.google.com/search?q=powershell+exit+code
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



All times are GMT -5. The time now is 09:08 PM.


Copyright © 1999-2023 Kinook Software, Inc.