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:
@@ -9,7 +9,7 @@
|
|||||||
# internet that could never arrive on towers, hanging first logon forever.
|
# internet that could never arrive on towers, hanging first logon forever.
|
||||||
|
|
||||||
$wifi = Get-NetAdapter -Physical -ErrorAction SilentlyContinue |
|
$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) {
|
if (-not $wifi) {
|
||||||
Write-Host 'No WiFi adapter - staying on ethernet.' -ForegroundColor Cyan
|
Write-Host 'No WiFi adapter - staying on ethernet.' -ForegroundColor Cyan
|
||||||
@@ -17,7 +17,7 @@ if (-not $wifi) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Get-NetAdapter -Physical |
|
Get-NetAdapter -Physical |
|
||||||
Where-Object { $_.InterfaceDescription -notmatch 'Wi-Fi|Wireless' } |
|
Where-Object { $_.InterfaceDescription -notmatch 'Wi-?Fi|Wireless|WLAN|802\.11' } |
|
||||||
Disable-NetAdapter -Confirm:$false
|
Disable-NetAdapter -Confirm:$false
|
||||||
|
|
||||||
$deadline = (Get-Date).AddMinutes(5)
|
$deadline = (Get-Date).AddMinutes(5)
|
||||||
@@ -37,7 +37,7 @@ if ($ok) {
|
|||||||
} else {
|
} else {
|
||||||
Write-Host 'WiFi internet timeout - re-enabling ethernet.' -ForegroundColor Yellow
|
Write-Host 'WiFi internet timeout - re-enabling ethernet.' -ForegroundColor Yellow
|
||||||
Get-NetAdapter -Physical |
|
Get-NetAdapter -Physical |
|
||||||
Where-Object { $_.InterfaceDescription -notmatch 'Wi-Fi|Wireless' } |
|
Where-Object { $_.InterfaceDescription -notmatch 'Wi-?Fi|Wireless|WLAN|802\.11' } |
|
||||||
Enable-NetAdapter -Confirm:$false
|
Enable-NetAdapter -Confirm:$false
|
||||||
}
|
}
|
||||||
exit 0
|
exit 0
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ Write-Host ""
|
|||||||
# ============================================================================
|
# ============================================================================
|
||||||
try {
|
try {
|
||||||
Get-NetAdapter -Physical -ErrorAction SilentlyContinue |
|
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
|
Enable-NetAdapter -Confirm:$false -ErrorAction SilentlyContinue
|
||||||
Write-Host "Wired NICs re-enabled (was migrate-to-wifi.ps1 had disabled them on laptops)."
|
Write-Host "Wired NICs re-enabled (was migrate-to-wifi.ps1 had disabled them on laptops)."
|
||||||
} catch {
|
} catch {
|
||||||
|
|||||||
Reference in New Issue
Block a user