Skip to content

Commit 5fdd462

Browse files
committed
Fix HTML report generation error by escaping $ in PowerShell here-string (fixes #105)
The JavaScript regex special character escaping pattern contained unescaped $ characters (${} and $&) inside a PowerShell expandable here-string, causing parse errors when generating the HTML report. Added backtick escapes so PowerShell outputs literal $ in the generated JavaScript. Bump version to 3.8.2.
1 parent a956c55 commit 5fdd462

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

IntuneAssignmentChecker.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ $clientSecret = if ($ClientSecret) { $ClientSecret } else { '' } # Client Secret
284284
####################################################################################################
285285

286286
# Version of the local script
287-
$localVersion = "3.8.1"
287+
$localVersion = "3.8.2"
288288

289289
Write-Host "🔍 INTUNE ASSIGNMENT CHECKER" -ForegroundColor Cyan
290290
Write-Host "Made by Ugur Koc with" -NoNewline; Write-Host " ❤️ and ☕" -NoNewline

html-export.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -552,8 +552,8 @@ function Export-HTMLReport {
552552
if (filterValue === 'all') {
553553
dataTable.column(colIdx).search('').draw();
554554
} else {
555-
var escaped = filterValue.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
556-
dataTable.column(colIdx).search('(?:^|,\\s*)' + escaped + '(?:\\s*,|$)', true, false).draw();
555+
var escaped = filterValue.replace(/[.*+?^`${}()|[\]\\]/g, '\\`$&');
556+
dataTable.column(colIdx).search('(?:^|,\\s*)' + escaped + '(?:\\s*,|`$)', true, false).draw();
557557
}
558558
}
559559
});
@@ -569,8 +569,8 @@ function Export-HTMLReport {
569569
if (filterValue === 'all') {
570570
dataTable.column(colIdx).search('').draw();
571571
} else {
572-
var escaped = filterValue.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
573-
dataTable.column(colIdx).search('^' + escaped + '$', true, false).draw();
572+
var escaped = filterValue.replace(/[.*+?^`${}()|[\]\\]/g, '\\`$&');
573+
dataTable.column(colIdx).search('^' + escaped + '`$', true, false).draw();
574574
}
575575
}
576576
});

version_v3.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.8.1
1+
3.8.2

0 commit comments

Comments
 (0)