From a334a56f1ea4448b3462732052d0c6f93d0320d3 Mon Sep 17 00:00:00 2001 From: cproudlock Date: Wed, 15 Apr 2026 18:03:19 -0400 Subject: [PATCH] WiFi detection: widen regex to catch hyphen-less 'WiFi' + 802.11 Realtek RTL8852BE describes itself as 'Realtek RTL8852BE WiFi 6 802.11ax PCIe Adapter' -- no hyphen in 'WiFi' -- which the previous regex 'Wi-Fi|Wireless' rejected. migrate-to-wifi.ps1's gate then exited 0 silently and neither wired NIC got disabled, leaving the imaging chain running over PXE ethernet for the entire PPKG phase. New regex Wi-?Fi|Wireless|WLAN|802\.11 covers: - Wi-Fi (Intel-style with hyphen) - WiFi (Realtek-style without hyphen) - Wireless (Intel Wireless-AC, Killer Wireless) - WLAN (some Realtek/MediaTek variants) - 802.11 (vendor-agnostic spec reference, fallback) Applied in two callers: - migrate-to-wifi.ps1 (3 occurrences: gate + disable + re-enable on timeout) - Monitor-IntuneProgress.ps1 (re-enable wired on sync_intune startup) Co-Authored-By: Claude Opus 4.6 (1M context) --- playbook/migrate-to-wifi.ps1 | 6 +++--- .../Shopfloor/lib/Monitor-IntuneProgress.ps1 | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/playbook/migrate-to-wifi.ps1 b/playbook/migrate-to-wifi.ps1 index 4792554..be803f0 100644 --- a/playbook/migrate-to-wifi.ps1 +++ b/playbook/migrate-to-wifi.ps1 @@ -9,7 +9,7 @@ # internet that could never arrive on towers, hanging first logon forever. $wifi = Get-NetAdapter -Physical -ErrorAction SilentlyContinue | - Where-Object { $_.InterfaceDescription -match 'Wi-Fi|Wireless' } + Where-Object { $_.InterfaceDescription -match 'Wi-?Fi|Wireless|WLAN|802\.11' } if (-not $wifi) { Write-Host 'No WiFi adapter - staying on ethernet.' -ForegroundColor Cyan @@ -17,7 +17,7 @@ if (-not $wifi) { } Get-NetAdapter -Physical | - Where-Object { $_.InterfaceDescription -notmatch 'Wi-Fi|Wireless' } | + Where-Object { $_.InterfaceDescription -notmatch 'Wi-?Fi|Wireless|WLAN|802\.11' } | Disable-NetAdapter -Confirm:$false $deadline = (Get-Date).AddMinutes(5) @@ -37,7 +37,7 @@ if ($ok) { } else { Write-Host 'WiFi internet timeout - re-enabling ethernet.' -ForegroundColor Yellow Get-NetAdapter -Physical | - Where-Object { $_.InterfaceDescription -notmatch 'Wi-Fi|Wireless' } | + Where-Object { $_.InterfaceDescription -notmatch 'Wi-?Fi|Wireless|WLAN|802\.11' } | Enable-NetAdapter -Confirm:$false } exit 0 diff --git a/playbook/shopfloor-setup/Shopfloor/lib/Monitor-IntuneProgress.ps1 b/playbook/shopfloor-setup/Shopfloor/lib/Monitor-IntuneProgress.ps1 index f32d1a9..b51a408 100644 --- a/playbook/shopfloor-setup/Shopfloor/lib/Monitor-IntuneProgress.ps1 +++ b/playbook/shopfloor-setup/Shopfloor/lib/Monitor-IntuneProgress.ps1 @@ -105,7 +105,7 @@ Write-Host "" # ============================================================================ try { Get-NetAdapter -Physical -ErrorAction SilentlyContinue | - Where-Object { $_.InterfaceDescription -notmatch 'Wi-Fi|Wireless' } | + Where-Object { $_.InterfaceDescription -notmatch 'Wi-?Fi|Wireless|WLAN|802\.11' } | Enable-NetAdapter -Confirm:$false -ErrorAction SilentlyContinue Write-Host "Wired NICs re-enabled (was migrate-to-wifi.ps1 had disabled them on laptops)." } catch {