From e69013b442bd13f55739ec319475c95ce9ecb8c9 Mon Sep 17 00:00:00 2001 From: Niko Ehrenfeuchter <nikolaus.ehrenfeuchter@unibas.ch> Date: Tue, 20 Feb 2018 16:16:30 +0100 Subject: [PATCH] Use an array to generate messages on updated items. --- Updater/Update-Service.ps1 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Updater/Update-Service.ps1 b/Updater/Update-Service.ps1 index cb0190b..8ccaa6b 100644 --- a/Updater/Update-Service.ps1 +++ b/Updater/Update-Service.ps1 @@ -568,6 +568,7 @@ Exit-IfDirMissing $UploadPathLogs "log file target" # terminates the entire script: Upload-LogFiles +$UpdItems = @() $ConfigShouldBeUpdated = NewConfig-Available $ConfigPath $ServiceShouldBeUpdated = ServiceUpdate-Requested if (-Not ($ConfigShouldBeUpdated -Or $ServiceShouldBeUpdated)) { @@ -579,13 +580,15 @@ if (-Not ($ConfigShouldBeUpdated -Or $ServiceShouldBeUpdated)) { $ConfigToTest = $ConfigPath if ($ConfigShouldBeUpdated) { $ConfigToTest = $UpdPathConfig + $UpdItems += "configuration files" } # define which configuration checker executable should be used for testing: $ConfigTestBinary = "$($InstallationPath)\AutoTxConfigTest.exe" if ($ServiceShouldBeUpdated) { $UpdPackage = Find-InstallationPackage - $ConfigTestBinary = "$($UpdPackage)\AutoTx\AutoTxConfigTest.exe" + $ConfigTestBinary = "$($UpdPackage)\$($ServiceName)\AutoTxConfigTest.exe" + $UpdItems += "service binaries" } # now we're all set and can run the config test: @@ -607,7 +610,7 @@ if (-Not ($ConfigValid)) { # (1) something needs to be updated (config, service or both) # AND # (2) the configuration validates with the corresponding service version -$UpdSummary = "" +Write-Verbose "Required update action items:`n> - $($UpdItems -join "`n> - ")`n" if ($ConfigShouldBeUpdated) { $ConfigUpdated = Update-Configuration -- GitLab