Hi,
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 {
"A"
}
Task B {
throw "I failed"
}
Task C {
"C"
}
Task Cleanup {
"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?