Skip to content
Snippets Groups Projects
Commit 75318209 authored by Niko Ehrenfeuchter's avatar Niko Ehrenfeuchter :keyboard:
Browse files

Send an email before terminating upon an error.

Refers to #18, #28
parent 61db2dab
Branches
Tags
No related merge requests found
...@@ -614,7 +614,9 @@ Write-Verbose "Required update action items:`n> - $($UpdItems -join "`n> - ")`n" ...@@ -614,7 +614,9 @@ Write-Verbose "Required update action items:`n> - $($UpdItems -join "`n> - ")`n"
if ($ConfigShouldBeUpdated) { if ($ConfigShouldBeUpdated) {
$ConfigUpdated = Update-Configuration $ConfigUpdated = Update-Configuration
if (-Not $ConfigUpdated) { if (-Not $ConfigUpdated) {
Log-Error "Updating the configuration failed, $($Me) terminating!" $msg = "Updating the configuration failed, $($Me) terminating!"
Log-Error $msg
Send-MailReport -Subject "updated failed!" -Body $msg
Exit Exit
} }
} }
...@@ -622,7 +624,9 @@ if ($ConfigShouldBeUpdated) { ...@@ -622,7 +624,9 @@ if ($ConfigShouldBeUpdated) {
if ($ServiceShouldBeUpdated) { if ($ServiceShouldBeUpdated) {
$ServiceUpdated = Update-ServiceBinaries $ServiceUpdated = Update-ServiceBinaries
if (-Not $ServiceUpdated) { if (-Not $ServiceUpdated) {
Log-Error "Updating the service binaries failed, $($Me) terminating!" $msg = "Updating the service binaries failed, $($Me) terminating!"
Log-Error $msg
Send-MailReport -Subject "updated failed!" -Body $msg
Exit Exit
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment