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