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