none
Failed Powershell Apps to Stop/Exit/Fail the Task Sequence RRS feed

  • Question

  • I have an MDT 2010 deployment that runs Powershell scripts as applications. If there's any errors in the script I exit with some number other than 0 or 3010. My problem is that when an (any) app fails, the task sequence continues on until the end, then reports all the "errors" with a yellow Finish summary page. I want a failed application to immediately halt and exit the Task sequence, specifically with a red summary screen, as it should since the continue on error is not checked.
    Wednesday, December 10, 2014 3:32 AM

Answers

  • Allowing failed installations of *Applications* to continue is by design in ZTIAPplications.wsf

    If you don't like the behavior:

    1. Change ZTIApplications.wsf to return non zero upon any application returning non-zero <meh>

    2. Move your application to a step in the Task Sequence, and ensure the step is *not* marked as *continue on error* that is the very definition of what red deployment screen summarizes.


    Keith Garner - Principal Consultant [owner] - http://DeploymentLive.com

    Thursday, December 11, 2014 7:39 PM
    Moderator

All replies

  • How are you exiting your script? Exit 1 has worked for me and I use a ton of PS in my sequences.

    This is a pretty good article on error handling and PS - http://scriptimus.wordpress.com/2012/09/28/ltizti-powershell-exit-codes/

    • Edited by MrBrooks Wednesday, December 10, 2014 3:05 PM added article on error handling.
    Wednesday, December 10, 2014 3:04 PM
  • Allowing failed installations of *Applications* to continue is by design in ZTIAPplications.wsf

    If you don't like the behavior:

    1. Change ZTIApplications.wsf to return non zero upon any application returning non-zero <meh>

    2. Move your application to a step in the Task Sequence, and ensure the step is *not* marked as *continue on error* that is the very definition of what red deployment screen summarizes.


    Keith Garner - Principal Consultant [owner] - http://DeploymentLive.com

    Thursday, December 11, 2014 7:39 PM
    Moderator