diff --git a/Updater/Update-Service.ps1 b/Updater/Update-Service.ps1 index 13fc554bad594c2e11201d5d6b0eee689323d370..1d2910df4e2abcb8427c2cf39ff0d579a2dd7022 100644 --- a/Updater/Update-Service.ps1 +++ b/Updater/Update-Service.ps1 @@ -617,7 +617,6 @@ if ($ConfigShouldBeUpdated) { Log-Error "Updating the configuration failed, $($Me) terminating!" Exit } - $UpdSummary += "The configuration files were updated.`n" } if ($ServiceShouldBeUpdated) { @@ -628,20 +627,26 @@ if ($ServiceShouldBeUpdated) { } } -Exit +$UpdSummary = "Updated $($UpdItems -join " and ")." -if ($msg -ne "") { - if ($ServiceRunningBefore) { - Log-Debug "Update action occurred, finishing up..." - Start-MyService - } else { - Log-Debug "Not starting the service as it was not running before." - } - Send-MailReport -Subject "Config and / or service has been updated!" ` - -Body $msg + +if ($ServiceRunningBefore) { + Log-Debug "$($UpdSummary) Trying to start the service again..." + Start-MyService +} else { + Log-Debug "$($UpdSummary) Leaving the service stopped, as it was before." +} + +$UpdDetails = $("An $($Me) run completed successfully. Updated items:" + "`n> - $($UpdItems -join "`n> - ")") +if ($ConfigUpdated) { + $UpdDetails += "`n`nConfiguration validation summary:`n$($ConfigSummary)" } +Send-MailReport -Subject "$UpdSummary" -Body "$UpdDetails" + + Upload-LogFiles Log-Debug "$($Me) finished." \ No newline at end of file