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) <noreply@anthropic.com>
This commit is contained in:
cproudlock
2026-04-15 18:03:19 -04:00
parent c23b803dc6
commit a334a56f1e
2 changed files with 4 additions and 4 deletions

View File

@@ -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