如何在psake任务列表中的任何任务中收到任何错误通知。?
在通知处理程序中,我想显示任务失败的窗口通知。但是 psake 吞下了异常并将其写入控制台。
更新: 这是吞下错误的 Psake 构建脚本中的代码
# if we are running in a nested scope (i.e. running a psake script from a psake script) then we need to re-throw the exception
# so that the parent script will fail otherwise the parent script will report a successful build
$inNestedScope = ($psake.context.count -gt 1)
if ( $inNestedScope ) {
throw $_
} else {
if (!$psake.run_by_psake_build_tester) {
WriteColoredOutput $error_message -foregroundcolor Red
}
}