Skip to content

Commit 21e0400

Browse files
authored
Merge pull request #386 from VladDBA/dev
Minor bug fixes
2 parents bd86362 + 64dc351 commit 21e0400

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

PSBlitz.ps1

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Resources/styles.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ footer {
258258
td {
259259
vertical-align: top;
260260
}
261-
td:nth-child(3) {
261+
td:nth-child(4) {
262262
position: sticky;
263263
left: 0;
264264
background-color: rgba(255, 255, 255, 0.7);
@@ -294,7 +294,7 @@ footer {
294294
td {
295295
vertical-align: top;
296296
}
297-
td:nth-child(2) {
297+
td:nth-child(3) {
298298
position: sticky;
299299
left: 0;
300300
background-color: rgba(255, 255, 255, 0.7);

0 commit comments

Comments
 (0)