Skip to content

Commit 42ee8a3

Browse files
committed
v1.16.3 — Null ProviderName guard in Event Log Alerts
Fix: Event Log Alert Summary guards against null ProviderName on events. Null provider caused "cannot call method on null-valued expression" on .PadRight() in both the top sources list and latest events list. 63 modules, 1854 tests, 38679 monolithic lines.
1 parent 34b4515 commit 42ee8a3

6 files changed

Lines changed: 15 additions & 6 deletions

File tree

Changelog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
## v1.16.3
4+
5+
- **Bug Fix:** Event Log Alert Summary guards against null `ProviderName` on events — events with null provider caused a "cannot call method on null-valued expression" error on `.PadRight()` in both the top sources list and the latest critical/error events list. Now defaults to "Unknown" (35-Utilities).
6+
- 63 modules, 1854 tests
7+
38
## v1.16.2
49

510
- **Bug Fix:** Drift detection baseline comparison validates user input before integer cast — previously, non-numeric input to the baseline number prompts was cast via `-as [int]` which returns `$null`, then subtracted by 1 producing `-1`, silently failing the range check without user feedback. Now validates with regex and shows an error message (45-ConfigExport).

Header.ps1

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,15 @@
3030
7h3 4b1d3r
3131
3232
.VERSION
33-
1.16.2
33+
1.16.3
3434
3535
.LAST UPDATED
3636
03/04/2026
3737
38+
.CHANGELOG v1.16.3
39+
NULL PROVIDER NAME GUARD IN EVENT LOG ALERTS:
40+
- FIX: Event Log Alert Summary guards against null ProviderName — events with null provider caused a "cannot call method on null-valued expression" error on .PadRight() in both the top sources list and the latest events list (35-Utilities)
41+
3842
.CHANGELOG v1.16.2
3943
DRIFT BASELINE INPUT VALIDATION:
4044
- FIX: Drift detection baseline comparison validates user input before integer cast — previously, non-numeric input to the baseline number prompts was cast via -as [int] which returns $null, then subtracted by 1 producing -1, silently failing the range check without user feedback. Now validates with regex and shows an error message (45-ConfigExport)

Modules/00-Initialization.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ if (-not $script:ModuleRoot) { $script:ModuleRoot = $PSScriptRoot }
135135
if (-not $script:ModuleRoot -and $script:ScriptPath) {
136136
$script:ModuleRoot = [System.IO.Path]::GetDirectoryName($script:ScriptPath)
137137
}
138-
$script:ScriptVersion = "1.16.2"
138+
$script:ScriptVersion = "1.16.3"
139139
$script:ScriptStartTime = Get-Date
140140

141141
# OS version detection (for feature compatibility)

Modules/35-Utilities.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1396,7 +1396,7 @@ function Show-EventLogAlerts {
13961396
Write-OutputColor " ├────────────────────────────────────────────────────────────────────────┤" -color "Info"
13971397
$topN = $grouped | Select-Object -First 15
13981398
foreach ($g in $topN) {
1399-
$srcName = $g.Name
1399+
$srcName = if ($g.Name) { $g.Name } else { "Unknown" }
14001400
if ($srcName.Length -gt 35) { $srcName = $srcName.Substring(0, 32) + "..." }
14011401
$latestEvent = $g.Group | Sort-Object { $_.Event.TimeCreated } -Descending | Select-Object -First 1
14021402
$age = [math]::Round(((Get-Date) - $latestEvent.Event.TimeCreated).TotalHours, 1)
@@ -1418,7 +1418,7 @@ function Show-EventLogAlerts {
14181418
foreach ($item in $topEvents) {
14191419
$e = $item.Event
14201420
$time = $e.TimeCreated.ToString("MM/dd HH:mm")
1421-
$src = $e.ProviderName
1421+
$src = if ($e.ProviderName) { $e.ProviderName } else { "Unknown" }
14221422
if ($src.Length -gt 22) { $src = $src.Substring(0, 19) + "..." }
14231423
$msg = ($e.Message -split "`n")[0]
14241424
if ($null -eq $msg) { $msg = "Event ID $($e.Id)" }

RackStack.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
Environment-specific settings are configured via defaults.json.
1414
1515
.VERSION
16-
1.16.2
16+
1.16.3
1717
1818
.NOTES
1919
- Requires Windows Server 2012 R2 or later (or Windows 10/11 for testing)

Tests/Run-Tests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<#
22
.SYNOPSIS
3-
Automated Test Runner for RackStack v1.16.2
3+
Automated Test Runner for RackStack v1.16.3
44
55
.DESCRIPTION
66
Comprehensive non-interactive test suite covering:

0 commit comments

Comments
 (0)