From 23ac23e0d5c50040f8c92e5cf2c6bf5464043216 Mon Sep 17 00:00:00 2001 From: Christoph <34290975+Soliseum@users.noreply.github.com> Date: Wed, 1 Oct 2025 12:58:05 -0700 Subject: [PATCH] Create Update-ReportDropdownName.ps1 Initial commit --- Update-ReportDropdownName.ps1 | 52 +++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 Update-ReportDropdownName.ps1 diff --git a/Update-ReportDropdownName.ps1 b/Update-ReportDropdownName.ps1 new file mode 100644 index 0000000..3cc71ec --- /dev/null +++ b/Update-ReportDropdownName.ps1 @@ -0,0 +1,52 @@ +# Use case: Combine reports from multiple servers into a single file (e.g., aggregating drift checks across environments). +# This script updates the dropdown label in the Reports tab, replacing the default timestamp with a custom value (e.g., database or server name) from the $replacementText variable. + +# Set your file paths +$htmlPath = "C:\Projects\DemoDB\report.html" +$outputPath = "C:\Projects\DemoDB\report.html" +$replacementText = "Latest Production DB Name" + +# Read the HTML file +$htmlContent = Get-Content -Path $htmlPath -Raw + +# Find the ' +$selectMatch = [regex]::Match($htmlContent, $selectPattern, [System.Text.RegularExpressions.RegexOptions]::Singleline) + +if ($selectMatch.Success) { + Write-Host "Found block + $newSelectBlock = $selectMatch.Value -replace [regex]::Escape($selectInnerHtml), [regex]::Escape($newSelectInnerHtml) -replace '\\', '' + + # Replace the entire in HTML." +}