From 0e105fdbf27c01fd05fd82700e9f959a704e61aa Mon Sep 17 00:00:00 2001 From: cproudlock Date: Fri, 8 May 2026 13:00:01 -0400 Subject: [PATCH] Run-ShopfloorSetup: vendor-agnostic wired NIC re-enable filter Filter by PhysicalMediaType + HardwareInterface instead of InterfaceDescription regex. Name/description varies per vendor (Realtek Gaming GbE, Intel I219-V, etc.) so a name-only filter missed adapters on some hardware. Keep an InterfaceDescription negative guard for drivers that mis-report PhysicalMediaType. Co-Authored-By: Claude Opus 4.7 (1M context) --- playbook/shopfloor-setup/Run-ShopfloorSetup.ps1 | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/playbook/shopfloor-setup/Run-ShopfloorSetup.ps1 b/playbook/shopfloor-setup/Run-ShopfloorSetup.ps1 index ac1821e..4e88b9c 100644 --- a/playbook/shopfloor-setup/Run-ShopfloorSetup.ps1 +++ b/playbook/shopfloor-setup/Run-ShopfloorSetup.ps1 @@ -300,8 +300,21 @@ $remLog = Join-Path $imeLogs 'Autologon_Remediation.log' if (-not (Test-Path $remLog)) { exit 0 } $content = Get-Content $remLog -Raw -ErrorAction SilentlyContinue if ($content -notmatch 'Autologon set for ShopFloor') { exit 0 } + +# Vendor-agnostic wired-NIC re-enable. NetAdapter "Name" varies wildly +# ("Ethernet", "Ethernet 2", "Network", per-vendor names like "Realtek +# Gaming GbE", "Intel(R) Ethernet Connection (10) I219-V") so filtering +# by Name is unreliable. Filter by PhysicalMediaType instead, with a +# keyword-negative guard for drivers that mis-report PhysicalMediaType. +# Captures Realtek, Intel, Broadcom, Marvell, Aquantia, etc. Get-NetAdapter -Physical -ErrorAction SilentlyContinue | - Where-Object { $_.InterfaceDescription -notmatch 'Wi-?Fi|Wireless|WLAN|802\.11' } | + Where-Object { + $_.HardwareInterface -eq $true -and + $_.PhysicalMediaType -ne 'Native 802.11' -and + $_.PhysicalMediaType -ne 'Wireless WAN' -and + $_.PhysicalMediaType -ne 'BlueTooth' -and + $_.InterfaceDescription -notmatch '(?i)Wi-?Fi|Wireless|WLAN|802\.11|Bluetooth' + } | Enable-NetAdapter -Confirm:$false -ErrorAction SilentlyContinue Unregister-ScheduledTask -TaskName 'GE Re-enable Wired NICs' -Confirm:$false -ErrorAction SilentlyContinue '@