Shopfloor self-heal: bootstrap recovery scripts + Keyence/WaxTrace heal
Fixes Keyence (and CMM/WaxTrace) imaging where the target got only partial data: the Y: SMB mount goes idle-dead during WIM apply, so WinPE staging dies early (often just after site-config.json + ppkg). The first-logon self-heal was meant to recover but its scripts were themselves staged past the death point, so nothing ran. - FlatUnattendW10-shopfloor.xml: new FirstLogonCommands Order-4 bootstrap that mounts the enrollment share fresh and pulls Fetch-StagingPayload / Verify-And-Heal-Staging / enrollment scripts into C:\Enrollment before the Order 5/6 heal runs. Recovery no longer depends on WinPE staging surviving. Keep CommandLine <=320 and Description <=252 chars: exceeding the unattend schema length limits makes the whole oobeSystem pass invalid (OOBE prompts, no autologon). - Verify-And-Heal-Staging.ps1: add Keyence and WaxTrace heavy-payload heal branches (previously only CMM). Keyence re-pulls installers-post\keyence\ <model> -> C:\KeyenceInstall\<model>; WaxTrace re-pulls the bundle (minus formtracepak) plus the bay-matched FORMTRACEPAK-V<ver>.iso. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -156,36 +156,41 @@
|
||||
</SynchronousCommand>
|
||||
<SynchronousCommand wcm:action="add">
|
||||
<Order>4</Order>
|
||||
<CommandLine>powershell.exe -ep Bypass -Command "net use Z: \\172.16.9.1\enrollment /user:pxe-upload pxe; robocopy Z:\shopfloor-setup C:\Enrollment Fetch-StagingPayload.ps1 Verify-And-Heal-Staging.ps1 /R:2 /W:2; robocopy Z:\scripts C:\Enrollment run-enrollment.ps1 wait-for-internet.ps1 migrate-to-wifi.ps1 /R:2 /W:2"</CommandLine>
|
||||
<Description>Bootstrap self-heal: pull Fetch/Verify-Heal + enrollment scripts from the PXE share so Order 5/6 run after an early WinPE staging failure.</Description>
|
||||
</SynchronousCommand>
|
||||
<SynchronousCommand wcm:action="add">
|
||||
<Order>5</Order>
|
||||
<CommandLine>powershell.exe -ExecutionPolicy Bypass -File "C:\Enrollment\Fetch-StagingPayload.ps1"</CommandLine>
|
||||
<Description>Fetch bulk staging (shopfloor-setup tree + preinstall bundle) from the PXE share on a fresh mount, BEFORE the production-network switch takes the bay off the imaging LAN. Detailed log at C:\Logs\Fetch\.</Description>
|
||||
</SynchronousCommand>
|
||||
<SynchronousCommand wcm:action="add">
|
||||
<Order>5</Order>
|
||||
<Order>6</Order>
|
||||
<CommandLine>powershell.exe -ExecutionPolicy Bypass -File "C:\Enrollment\Verify-And-Heal-Staging.ps1"</CommandLine>
|
||||
<Description>Verify every imaging payload arrived and re-pull anything missing from the PXE share (incl the CMM bundle + selected-bay backup) while still on the imaging LAN, BEFORE wait-for-internet switches the bay to the production network. Log at C:\Logs\Fetch\.</Description>
|
||||
<Description>Verify + re-pull any missing imaging payload from the PXE share (CMM/Keyence/WaxTrace bundles + bay backup) on the imaging LAN before the production-network switch. Log C:\Logs\Fetch.</Description>
|
||||
</SynchronousCommand>
|
||||
<SynchronousCommand wcm:action="add">
|
||||
<Order>6</Order>
|
||||
<Order>7</Order>
|
||||
<CommandLine>powershell.exe -ExecutionPolicy Bypass -File "C:\Enrollment\wait-for-internet.ps1"</CommandLine>
|
||||
<Description>Prompt to connect production network then wait for TCP 443 connectivity</Description>
|
||||
</SynchronousCommand>
|
||||
<SynchronousCommand wcm:action="add">
|
||||
<Order>7</Order>
|
||||
<Order>8</Order>
|
||||
<CommandLine>powershell.exe -ExecutionPolicy Bypass -File "C:\Enrollment\migrate-to-wifi.ps1"</CommandLine>
|
||||
<Description>Migrate from wired to WiFi if WiFi adapter present, else stay on wired</Description>
|
||||
</SynchronousCommand>
|
||||
<SynchronousCommand wcm:action="add">
|
||||
<Order>8</Order>
|
||||
<Order>9</Order>
|
||||
<CommandLine>msiexec.exe /i "C:\PreInstall\installers\powershell7\PowerShell-7.5.4-win-x64.msi" /qn /norestart ADD_PATH=1 USE_MU=0 ENABLE_MU=0 DISABLE_TELEMETRY=1</CommandLine>
|
||||
<Description>Install PowerShell 7 BEFORE PPKG so Intune SetupCredentials Win32App finds pwsh.exe (race fix)</Description>
|
||||
</SynchronousCommand>
|
||||
<SynchronousCommand wcm:action="add">
|
||||
<Order>9</Order>
|
||||
<Order>10</Order>
|
||||
<CommandLine>powershell.exe -ExecutionPolicy Bypass -File "C:\run-enrollment.ps1"</CommandLine>
|
||||
<Description>Run GCCH Enrollment</Description>
|
||||
</SynchronousCommand>
|
||||
<SynchronousCommand wcm:action="add">
|
||||
<Order>10</Order>
|
||||
<Order>11</Order>
|
||||
<CommandLine>powershell.exe -ExecutionPolicy Bypass -File "C:\Enrollment\Run-ShopfloorSetup.ps1"</CommandLine>
|
||||
<Description>Run shopfloor PC type setup</Description>
|
||||
</SynchronousCommand>
|
||||
|
||||
@@ -7,10 +7,12 @@ enrollment share. Runs in full Windows (reliable network), so it is immune to th
|
||||
WinPE samba-idle-drop that loses copies during the WIM apply.
|
||||
|
||||
Covers the generic Fetch payload (shopfloor-setup tree + preinstall bundle) AND
|
||||
the heavy per-type payload that Fetch-StagingPayload does NOT pull today: the CMM
|
||||
bundle (C:\CMM-Install) and the selected bay's backup set
|
||||
(C:\CMM-Install\backups\<cmmid>). That is the one that silently goes missing when
|
||||
WinPE staging runs out of time before reboot.
|
||||
the heavy per-type payloads that Fetch-StagingPayload does NOT pull today:
|
||||
- CMM C:\CMM-Install (+ selected bay's backup C:\CMM-Install\backups\<cmmid>)
|
||||
- Keyence C:\KeyenceInstall\<model> (MSI + Data*.cab)
|
||||
- WaxTrace C:\WaxTrace-Install (bundle + bay-matched FormTracePak ISO)
|
||||
These are the ones that silently go missing when WinPE staging runs out of time
|
||||
(idle-dead Y: mount) before reboot.
|
||||
|
||||
Designed to be:
|
||||
- run manually on a problem PC (Verify-And-Heal-Staging.bat), or
|
||||
@@ -89,6 +91,31 @@ if ($pcType -eq 'gea-shopfloor-cmm') {
|
||||
Add-Item "CMM backup ($cmmid)" "installers-post\cmm\backups\$cmmid" "C:\CMM-Install\backups\$cmmid" 'Dir' "C:\CMM-Install\backups\$cmmid" $null $true
|
||||
}
|
||||
}
|
||||
# --- heavy Keyence payload (same gap as CMM: WinPE-only staged, never re-pulled
|
||||
# by Fetch-StagingPayload). Only the selected model bundle lands under
|
||||
# C:\KeyenceInstall\<model>. Verify on the model manifest so a missing/partial
|
||||
# Data1.cab (the 700 MB - 2 GB payload msiexec SECREPAIR-hashes) gets re-pulled. ---
|
||||
if ($pcType -eq 'gea-shopfloor-keyence') {
|
||||
$kmodel = ReadTxt 'C:\Enrollment\keyence-model.txt'
|
||||
if (-not $kmodel) { $kmodel = 'vr6000' }
|
||||
Add-Item "Keyence bundle ($kmodel)" "installers-post\keyence\$kmodel" "C:\KeyenceInstall\$kmodel" 'Dir' "C:\KeyenceInstall\$kmodel\manifest.json"
|
||||
}
|
||||
# --- heavy WaxTrace payload (same gap as CMM/Keyence). Two parts, mirroring the
|
||||
# three-step WinPE stage: (1) the bundle minus the formtracepak\ ISO dir, and
|
||||
# (2) ONLY the bay's matched FORMTRACEPAK-V<ver>.iso, keyed on the version
|
||||
# resolve-bay-config wrote to C:\Enrollment\waxtrace\version.txt during WinPE.
|
||||
# If version.txt is missing (mount died before the resolver ran) the ISO cannot
|
||||
# be re-pulled here - the bundle+resolver still heal, and resolve-bay-config can
|
||||
# be re-run manually to regenerate version.txt then re-run this heal. ---
|
||||
if ($pcType -eq 'gea-shopfloor-waxtrace') {
|
||||
Add-Item 'WaxTrace bundle' 'installers-post\waxtrace' 'C:\WaxTrace-Install' 'Dir' 'C:\WaxTrace-Install\waxtrace-manifest.json' $null $false 'formtracepak'
|
||||
$wtver = ReadTxt 'C:\Enrollment\waxtrace\version.txt'
|
||||
if ($wtver) {
|
||||
Add-Item "WaxTrace FTPak V$wtver" 'installers-post\waxtrace\formtracepak' 'C:\WaxTrace-Install\formtracepak' 'File' "C:\WaxTrace-Install\formtracepak\FORMTRACEPAK-V$wtver.iso" @("FORMTRACEPAK-V$wtver.iso")
|
||||
} else {
|
||||
Log 'WaxTrace: version.txt absent - cannot heal the bay-specific FormTracePak ISO (re-run resolve-bay-config then re-run heal)' 'WARN'
|
||||
}
|
||||
}
|
||||
|
||||
# --- robocopy-based verify/heal -----------------------------------------------
|
||||
# Presence alone is NOT trusted: a partially transferred file (e.g. a truncated
|
||||
|
||||
Reference in New Issue
Block a user