Report hardware from the BIOS check, so every WinPE path is covered
The hardware report went out from winpe-status-push.ps1 on the enrollment share (Y:), but startnet.cmd never maps Y: on the gea-standard / gea-engineer path (choices 1/2 go purpose -> tenant -> enroll_staged), so those builds never reported. The same gap means neither the status push nor preflight.ps1's driver check has ever run for standard/engineer images. The BIOS share is mapped by every WinPE boot before the menu, and check-bios.cmd lives on it, so it now calls hardware-report.ps1 from the same folder (best effort, output discarded). winpe-status-push.ps1 goes back to status only, so shopfloor bays are not counted twice. The playbook deploys hardware-report.ps1 with the other BIOS files.
This commit is contained in:
@@ -547,6 +547,7 @@
|
||||
loop:
|
||||
- check-bios.cmd
|
||||
- models.txt
|
||||
- hardware-report.ps1
|
||||
ignore_errors: yes
|
||||
|
||||
- name: "Deploy Dell Flash64W.exe to winpeapps/_shared/BIOS/"
|
||||
|
||||
@@ -6,6 +6,11 @@ set "BIOSDIR=%~dp0"
|
||||
set "FLASH=%BIOSDIR%Flash64W.exe"
|
||||
set "MANIFEST=%BIOSDIR%models.txt"
|
||||
|
||||
REM --- Report this machine to the PXE webapp (Hardware Coverage) ---
|
||||
REM Every WinPE boot maps this share, whatever image is picked next, so this
|
||||
REM is the one place that sees standard/engineer builds too. Best effort.
|
||||
if exist "%BIOSDIR%hardware-report.ps1" powershell -NoProfile -ExecutionPolicy Bypass -File "%BIOSDIR%hardware-report.ps1" >NUL 2>&1
|
||||
|
||||
if exist "%FLASH%" goto :flash_ok
|
||||
echo Flash64W.exe not found, skipping BIOS check.
|
||||
set "BIOS_STATUS=Skipped (Flash64W.exe missing)"
|
||||
|
||||
59
playbook/shopfloor-setup/BIOS/hardware-report.ps1
Normal file
59
playbook/shopfloor-setup/BIOS/hardware-report.ps1
Normal file
@@ -0,0 +1,59 @@
|
||||
# hardware-report.ps1 - Report this machine's hardware to the PXE webapp so
|
||||
# its Hardware Coverage page can flag models with no driver pack or BIOS.
|
||||
#
|
||||
# Called by check-bios.cmd, which every WinPE boot runs from the BIOS share
|
||||
# before the imaging menu. That is deliberate: the enrollment share (Y:,
|
||||
# where winpe-status-push.ps1 lives) is never mapped on the gea-standard /
|
||||
# gea-engineer path, so anything hung off Y: misses those builds.
|
||||
#
|
||||
# Sends the exact WMI model PESetup matches driver packs on, the Dell
|
||||
# system SKU (what Dell's catalogs key on) and the BIOS version. Runs in
|
||||
# WinPE's stripped PowerShell: wmic only, no CIM cmdlets. Best effort:
|
||||
# logs to X:\Windows\Temp\hardware-report.log and never fails the boot.
|
||||
|
||||
param(
|
||||
[string]$PxeServer = $(if ($env:PXESERVER) { $env:PXESERVER } else { '172.16.9.1' }),
|
||||
[int]$Port = 9009,
|
||||
[int]$TimeoutSec = 5
|
||||
)
|
||||
|
||||
$logFile = 'X:\Windows\Temp\hardware-report.log'
|
||||
function Log {
|
||||
param([string]$msg)
|
||||
try { "$(Get-Date -Format s) $msg" | Out-File -FilePath $logFile -Append -Encoding utf8 } catch { }
|
||||
}
|
||||
|
||||
function Get-WmicValue {
|
||||
param([string]$Class, [string]$Property)
|
||||
try {
|
||||
$line = (& wmic $Class get $Property /value 2>$null |
|
||||
Where-Object { $_ -match '=' } | Select-Object -First 1)
|
||||
if ($line) { return ($line -split '=', 2)[1].Trim() }
|
||||
} catch { Log "wmic $Class $Property exception: $_" }
|
||||
return ''
|
||||
}
|
||||
|
||||
$hw = @{
|
||||
serial = Get-WmicValue 'bios' 'SerialNumber'
|
||||
model = Get-WmicValue 'computersystem' 'Model'
|
||||
manufacturer = Get-WmicValue 'computersystem' 'Manufacturer'
|
||||
sku = Get-WmicValue 'computersystem' 'SystemSKUNumber'
|
||||
bios_version = Get-WmicValue 'bios' 'SMBIOSBIOSVersion'
|
||||
}
|
||||
Log "model=$($hw.model) sku=$($hw.sku) bios=$($hw.bios_version) serial=$($hw.serial)"
|
||||
|
||||
if (-not $hw.model) {
|
||||
Log "no model - nothing to report"
|
||||
exit 0
|
||||
}
|
||||
|
||||
try {
|
||||
$resp = Invoke-WebRequest -Uri "http://${PxeServer}:${Port}/hardware/seen" -Method POST `
|
||||
-Body ($hw | ConvertTo-Json -Compress) -ContentType 'application/json' `
|
||||
-UseBasicParsing -TimeoutSec $TimeoutSec -ErrorAction Stop
|
||||
Log "OK http=$($resp.StatusCode)"
|
||||
} catch {
|
||||
Log "ERR $($_.Exception.Message)"
|
||||
}
|
||||
|
||||
exit 0
|
||||
@@ -74,36 +74,4 @@ try {
|
||||
Log "ERR $($_.Exception.Message)"
|
||||
}
|
||||
|
||||
# Hardware facts for the webapp's driver/BIOS coverage check (/hardware):
|
||||
# the exact WMI model PESetup matches driver packs on, the Dell system SKU
|
||||
# (what Dell's catalogs key on), and the BIOS version check-bios.cmd sees.
|
||||
function Get-WmicValue {
|
||||
param([string]$Class, [string]$Property)
|
||||
try {
|
||||
$line = (& wmic $Class get $Property /value 2>$null |
|
||||
Where-Object { $_ -match '=' } | Select-Object -First 1)
|
||||
if ($line) { return ($line -split '=', 2)[1].Trim() }
|
||||
} catch { Log "wmic $Class $Property exception: $_" }
|
||||
return ''
|
||||
}
|
||||
$hw = @{
|
||||
serial = $serial
|
||||
model = Get-WmicValue 'computersystem' 'Model'
|
||||
manufacturer = Get-WmicValue 'computersystem' 'Manufacturer'
|
||||
sku = Get-WmicValue 'computersystem' 'SystemSKUNumber'
|
||||
bios_version = Get-WmicValue 'bios' 'SMBIOSBIOSVersion'
|
||||
pctype = $PCType
|
||||
}
|
||||
Log "hardware model=$($hw.model) sku=$($hw.sku) bios=$($hw.bios_version)"
|
||||
if ($hw.model) {
|
||||
try {
|
||||
$resp = Invoke-WebRequest -Uri "http://${PxeServer}:${Port}/hardware/seen" -Method POST `
|
||||
-Body ($hw | ConvertTo-Json -Compress) -ContentType 'application/json' `
|
||||
-UseBasicParsing -TimeoutSec $TimeoutSec -ErrorAction Stop
|
||||
Log "hardware OK http=$($resp.StatusCode)"
|
||||
} catch {
|
||||
Log "hardware ERR $($_.Exception.Message)"
|
||||
}
|
||||
}
|
||||
|
||||
exit 0
|
||||
|
||||
Reference in New Issue
Block a user