From 8d271e88f116b92c2969c7eacce42f3771a79ccd Mon Sep 17 00:00:00 2001 From: stevecharon <37655537+stevecharon@users.noreply.github.com> Date: Mon, 19 Dec 2022 17:24:45 +0100 Subject: [PATCH 1/2] Update Get-HealthCheckFilesItemsFromLocation.ps1 A single xml report from a ExchangeDCCoreRatio broke the html report This could be achieved with another $endname for the ExchangeDC-file like _{0}.txt so that -*-*.xml does not match anymore --- .../Helpers/Get-HealthCheckFilesItemsFromLocation.ps1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Diagnostics/HealthChecker/Helpers/Get-HealthCheckFilesItemsFromLocation.ps1 b/Diagnostics/HealthChecker/Helpers/Get-HealthCheckFilesItemsFromLocation.ps1 index a3426e373c..4145e51ba1 100644 --- a/Diagnostics/HealthChecker/Helpers/Get-HealthCheckFilesItemsFromLocation.ps1 +++ b/Diagnostics/HealthChecker/Helpers/Get-HealthCheckFilesItemsFromLocation.ps1 @@ -2,7 +2,9 @@ # Licensed under the MIT License. function Get-HealthCheckFilesItemsFromLocation { - $items = Get-ChildItem $XMLDirectoryPath | Where-Object { $_.Name -like "HealthChecker-*-*.xml" } + ##This notation will break things if you have other xml files from runs with different parameters like exchangedccoreratio + ##Filenames to exclude: *ExchangeDCCoreRatio* , all other reports generate txt-reports only + $items = Get-ChildItem $XMLDirectoryPath | Where-Object { $_.Name -like "HealthChecker-*-*.xml" -and $_.Name -notlike "HealthChecker-ExchangeDCCoreRatio-*.xml"} if ($null -eq $items) { Write-Host("Doesn't appear to be any Health Check XML files here....stopping the script") From fa90244597fc34cf07af8fc21886df265fe8b9c6 Mon Sep 17 00:00:00 2001 From: stevecharon <37655537+stevecharon@users.noreply.github.com> Date: Mon, 19 Dec 2022 17:49:56 +0100 Subject: [PATCH 2/2] Update Get-HealthCheckFilesItemsFromLocation.ps1 fix formatting --- .../Helpers/Get-HealthCheckFilesItemsFromLocation.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Diagnostics/HealthChecker/Helpers/Get-HealthCheckFilesItemsFromLocation.ps1 b/Diagnostics/HealthChecker/Helpers/Get-HealthCheckFilesItemsFromLocation.ps1 index 4145e51ba1..6adc675f12 100644 --- a/Diagnostics/HealthChecker/Helpers/Get-HealthCheckFilesItemsFromLocation.ps1 +++ b/Diagnostics/HealthChecker/Helpers/Get-HealthCheckFilesItemsFromLocation.ps1 @@ -4,7 +4,7 @@ function Get-HealthCheckFilesItemsFromLocation { ##This notation will break things if you have other xml files from runs with different parameters like exchangedccoreratio ##Filenames to exclude: *ExchangeDCCoreRatio* , all other reports generate txt-reports only - $items = Get-ChildItem $XMLDirectoryPath | Where-Object { $_.Name -like "HealthChecker-*-*.xml" -and $_.Name -notlike "HealthChecker-ExchangeDCCoreRatio-*.xml"} + $items = Get-ChildItem $XMLDirectoryPath | Where-Object { $_.Name -like "HealthChecker-*-*.xml" -and $_.Name -notlike "HealthChecker-ExchangeDCCoreRatio-*.xml" } if ($null -eq $items) { Write-Host("Doesn't appear to be any Health Check XML files here....stopping the script")