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." +}