diff --git a/Updater/Update-Service.ps1 b/Updater/Update-Service.ps1 index 5a70ec871ad19e45812732d7fe285b19bc654e0d..d63e28751b3839ffabd3821161c67ec733d2acd0 100644 --- a/Updater/Update-Service.ps1 +++ b/Updater/Update-Service.ps1 @@ -307,7 +307,26 @@ function Upload-LogFiles { } +function Get-HostDescription() { + $Desc = $env:COMPUTERNAME + $ConfigXml = "$($InstallationPath)\configuration.xml" + try { + [xml]$XML = Get-Content $ConfigXml -ErrorAction Stop + # careful, we need a string comparison here: + $Desc += " ($($XML.ServiceConfig.HostAlias))" + } + catch { + $ex = $_.Exception.Message + $msg = "Trying to read the service config from [$($ConfigXml)] failed! " + $msg += "The reported error message was:`n$($ex)" + Log-Error $msg + } + Return $Desc +} + + function Send-MailReport([string]$Subject, [string]$Body) { + $Body = "Notification from $(Get-HostDescription)`n`n$($Body)" $Subject = "[$($Me)] $($env:COMPUTERNAME) - $($Subject)" $msg = "------------------------------`n" $msg += "From: $($EmailFrom)`n"