Modify psake to support optionally specifying a regular expression that can be used in combination with the maxRetries parameter to enable retry logic for only specific cases.

Usage:

task MyTask -maxRetries 3 -retryTriggerErrorPattern "Can't connect to database at this time"

This configuration will cause psake to retry MyTask only if an exception occurs where the exception message contains the phrase "Can't connect to database at this time".