@@ -302,8 +302,8 @@ param(
302302
303303# ##Internal params
304304# Version
305- $Vers = " 5.8.1 "
306- $VersDate = " 2025-07-30 "
305+ $Vers = " 5.8.2 "
306+ $VersDate = " 2025-09-09 "
307307$TwoMonthsFromRelease = [datetime ]::ParseExact(" $VersDate " , ' yyyy-MM-dd' , $null ).AddMonths(2 )
308308$NowDate = Get-Date
309309# Get script path
@@ -895,7 +895,15 @@ function Export-PlansAndDeadlocks {
895895 } else {
896896 $FileName = $FPrefix + ' _' + $i + ' .' + $OutputType
897897 }
898+ try {
898899 $DataTable.Rows [$RowNum ][$XMLColName ] | Format-XML | Set-Content - Path " $FileDir \$FileName " - Force
900+ } catch {
901+ # still exporting the file, but no longer formatting the XML and also loggin the error
902+ Write-Host " ->Error formatting XML for $FileName " - ForegroundColor Red
903+ Invoke-ErrMsg
904+ $DataTable.Rows [$RowNum ][$XMLColName ] | Set-Content - Path " $FileDir \$FileName " - Force
905+ Add-LogRow " ->Potentially malformed XML - $FileName " " Failure"
906+ }
899907 }
900908 if ($FileNameFromColumn -eq $false ) {
901909 $DataTable.Rows [$RowNum ][$FNameColName ] = $FileName
@@ -2828,7 +2836,7 @@ $SortableTable `n $htmlTable `n $JumpToTop `n $HTMLBodyEnd
28282836 # Handling CSS
28292837 $CacheHTMLPre = $HTMLPre
28302838 $CacheHTMLPre = $CacheHTMLPre -replace ' CacheTab1High' , $HighlightCol
2831- $htmlTable1 = $htmlTable1 -replace " <table class=' CacheTabx'> " , ' <table class="CacheTable1">'
2839+ $htmlTable1 = $htmlTable1 -replace ' <table class=" CacheTabx"> ' , ' <table class="CacheTable1">'
28322840
28332841 if ($SheetName -eq " Mem & Recent Comp" ) {
28342842 $HtmlTabName = " Queries by Memory Grants & Recent Compilations"
@@ -3176,11 +3184,11 @@ $SortableTable `n $htmlTable `n $JumpToTop `n $HTMLBodyEnd
31763184 if ((! ([string ]::IsNullOrEmpty($CheckDB ))) -or ($IsAzureSQLDB )) {
31773185 $HtmlTabName += " for $ASDBName$CheckDB "
31783186 $ExclCols = @ (" Sample Query Plan" , " Display Order" , " Database Name" , " Finding" , " URL" )
3179- $Mode2SearchCol = 0
3187+ $Mode2SearchCol = 2
31803188 $Mode2CSS = " IndexUsageTableDB sortable"
31813189 } else {
31823190 $ExclCols = @ (" Sample Query Plan" , " Display Order" , " Finding" , " URL" )
3183- $Mode2SearchCol = 1
3191+ $Mode2SearchCol = 3
31843192 $Mode2CSS = " IndexUsageTable sortable"
31853193 }
31863194
0 commit comments