Teardown task for entire psake script

Skip to first unread message

Michael Di Nicola

Sep 20, 2012, 8:53:32 PM9/20/12
to psake...@googlegroups.com

I would like to specify a task that will always run when all psake tasks have finished, even if an error occurs, which would do some cleanup.
I am looking for something similar to the task teardown, but at the end of all tasks instead of every task.

An example is:

Task default -Depends A, B, C, Clean

Task A {

Task B {
    throw "I failed"

Task C {

Task Cleanup {

In this scenario, Task C should not be run, because Task B caused an error.  However, Task Cleanup should still always run.

Does anyone have any suggestions on how to do this, or if it is even possible?
Reply all
Reply to author
0 new messages