Skip to content

Commit 5c52a9d

Browse files
committed
v1.9.18 — Fix single-object .Count failures in SET, storage backends, network sweep
Wrap pipeline results in @() to guarantee array with .Count property in PS 5.1. Single Where-Object results have no .Count, causing false negatives in detection logic.
1 parent f794d63 commit 5c52a9d

8 files changed

Lines changed: 29 additions & 13 deletions

File tree

Changelog.md

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

3+
## v1.9.18
4+
5+
- **Bug Fix:** SET team auto-detection failed on 2-NIC servers — single pipeline result from `Where-Object` has no `.Count` property in PS 5.1, so `.Count -gt 0` returned false. iSCSI candidate adapters were never identified. Wrapped pipeline results in `@()` array subexpression (09-SET).
6+
- **Bug Fix:** Storage backend detection missed Fibre Channel when only one HBA present — `$fcAdapters -and $fcAdapters.Count -gt 0` evaluated to false for single objects. Same bug for single NVMe disks. Wrapped in `@()` (59-StorageBackends).
7+
- **Bug Fix:** FC adapter display function skipped all content when only one HBA port existed — same single-object `.Count` pattern (59-StorageBackends).
8+
- **Bug Fix:** Network sweep "No hosts responded" message never displayed — when `$alive` is `$null` (zero results), `.Count -eq 0` evaluates to `$null -eq 0` which is false. Wrapped in `@()` (58-NetworkDiagnostics).
9+
- 63 modules, 1854 tests
10+
311
## v1.9.17
412

513
- **Bug Fix:** Division by zero / NaN cascade in performance dashboard when CIM returns null — memory percentage and progress bar produced errors. Added `-ErrorAction SilentlyContinue` and zero guards (28-PerformanceDashboard).

Header.ps1

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,19 @@
3030
7h3 4b1d3r
3131
3232
.VERSION
33-
1.9.17
33+
1.9.18
3434
3535
.LAST UPDATED
3636
02/25/2026
3737
38+
.CHANGELOG v1.9.18
39+
BUG FIXES:
40+
- FIXED: Single pipeline result .Count returns null in PS 5.1 — SET team detection missed single no-internet adapter for iSCSI (09-SET)
41+
- FIXED: FC adapter detection returned false for single HBA — storage backend misidentified as Local (59-StorageBackends)
42+
- FIXED: NVMe disk detection returned false for single drive — storage backend misidentified as Local (59-StorageBackends)
43+
- FIXED: FC port display skipped when only one HBA present (59-StorageBackends)
44+
- FIXED: Network sweep "No hosts responded" message never shown when zero hosts alive (58-NetworkDiagnostics)
45+
3846
.CHANGELOG v1.9.17
3947
BUG FIXES:
4048
- FIXED: Division by zero / NaN in performance dashboard when CIM returns null (28-PerformanceDashboard)

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.9.17"
138+
$script:ScriptVersion = "1.9.18"
139139
$script:ScriptStartTime = Get-Date
140140

141141
# OS version detection (for feature compatibility)

Modules/09-SET.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ function Select-PhysicalAdaptersSmart {
108108
Write-OutputColor "" -color "Info"
109109

110110
# Select adapters with internet
111-
$internetAdapters = $results | Where-Object { $_.HasInternet }
112-
$noInternetAdapters = $results | Where-Object { -not $_.HasInternet }
111+
$internetAdapters = @($results | Where-Object { $_.HasInternet })
112+
$noInternetAdapters = @($results | Where-Object { -not $_.HasInternet })
113113

114114
if ($internetAdapters.Count -eq 0) {
115115
Write-OutputColor "No adapters with internet connectivity found." -color "Warning"

Modules/58-NetworkDiagnostics.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ function Invoke-SubnetSweep {
217217
$results = $jobs | Wait-Job -Timeout 30 | Receive-Job
218218
$jobs | Remove-Job -Force
219219

220-
$alive = $results | Where-Object { $_.Alive } | Sort-Object { ($_.IP -split '\.') | ForEach-Object { [int]$_ } }
220+
$alive = @($results | Where-Object { $_.Alive } | Sort-Object { ($_.IP -split '\.') | ForEach-Object { [int]$_ } })
221221

222222
Write-OutputColor "" -color "Info"
223223
Write-OutputColor " ┌────────────────────────────────────────────────────────────────────────┐" -color "Info"

Modules/59-StorageBackends.ps1

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ function Get-DetectedStorageBackend {
6969
catch { }
7070

7171
# Check for FC HBAs
72-
$fcAdapters = Get-InitiatorPort -ErrorAction SilentlyContinue | Where-Object { $_.ConnectionType -eq "Fibre Channel" }
73-
if ($fcAdapters -and $fcAdapters.Count -gt 0) {
72+
$fcAdapters = @(Get-InitiatorPort -ErrorAction SilentlyContinue | Where-Object { $_.ConnectionType -eq "Fibre Channel" })
73+
if ($fcAdapters.Count -gt 0) {
7474
# Check if FC disks are present
7575
$fcDisks = Get-Disk -ErrorAction SilentlyContinue | Where-Object { $_.BusType -eq "Fibre Channel" }
7676
if ($fcDisks) { return "FC" }
@@ -85,8 +85,8 @@ function Get-DetectedStorageBackend {
8585
catch { }
8686

8787
# Check for NVMe-oF
88-
$nvmeDisks = Get-Disk -ErrorAction SilentlyContinue | Where-Object { $_.BusType -eq "NVMe" }
89-
if ($nvmeDisks -and $nvmeDisks.Count -gt 0) { return "NVMeoF" }
88+
$nvmeDisks = @(Get-Disk -ErrorAction SilentlyContinue | Where-Object { $_.BusType -eq "NVMe" })
89+
if ($nvmeDisks.Count -gt 0) { return "NVMeoF" }
9090

9191
return "Local"
9292
}
@@ -105,9 +105,9 @@ function Show-FCAdapters {
105105
Write-OutputColor "$(" FC HOST BUS ADAPTERS".PadRight(72))" -color "Info"
106106
Write-OutputColor " ├────────────────────────────────────────────────────────────────────────┤" -color "Info"
107107

108-
$fcPorts = Get-InitiatorPort -ErrorAction SilentlyContinue | Where-Object { $_.ConnectionType -eq "Fibre Channel" }
108+
$fcPorts = @(Get-InitiatorPort -ErrorAction SilentlyContinue | Where-Object { $_.ConnectionType -eq "Fibre Channel" })
109109

110-
if ($fcPorts -and $fcPorts.Count -gt 0) {
110+
if ($fcPorts.Count -gt 0) {
111111
$index = 1
112112
foreach ($port in $fcPorts) {
113113
$status = $port.OperationalStatus

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.9.17
16+
1.9.18
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.9.17
3+
Automated Test Runner for RackStack v1.9.18
44
55
.DESCRIPTION
66
Comprehensive non-interactive test suite covering:

0 commit comments

Comments
 (0)