Files
pxe-server/playbook/shopfloor-setup/gea-shopfloor-cmm/resolve-cmm-bay-config.ps1
cproudlock 5e13d38512 CMM per-bay PC-DMIS version selection + DODA deploy
Add bay picker (same arrow-key pattern as waxtrace) that maps CMM1-12
to a PC-DMIS version (2016/2019/2026) and DODA flag via cmm-bay-config.csv.

startnet.cmd: replace Standard/DODA submenu with bay picker. Writes
CMMID (e.g. CMM4) to machine-number.txt so the existing
TargetMachineNumbers filter on the SFLD share manifest gates per-bay
entries with no lib changes.

09-Setup-CMM: reads resolved version.txt and filters cmm-manifest.json
by _CmmVersion tag at imaging time so only the matched PC-DMIS version
installs.

cmm-manifest.json: add PC-DMIS 2026.1 entry (patched MSI, product code
{81BACE1B-FB08-4DCF-8100-79911AD3EC1E}) and DODA entry (flat zip extract
to C:\Apps\DODA\). Existing 2016/2019 entries tagged with _CmmVersion.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-27 12:01:27 -04:00

51 lines
1.5 KiB
PowerShell

# resolve-cmm-bay-config.ps1 - Resolve CMM bay config from cmm-bay-config.csv.
#
# Called by startnet.cmd after the bay picker. Reads the CSV from the PXE
# enrollment share, looks up the selected CMM ID, and writes:
# W:\Enrollment\cmm\version.txt (e.g. "2019")
# W:\Enrollment\cmm\doda.txt (e.g. "yes" or "no")
#
# 09-Setup-CMM.ps1 reads these at install time to gate which PC-DMIS
# version gets installed and whether DODA is deployed.
param(
[Parameter(Mandatory=$true)][string]$ConfigPath,
[Parameter(Mandatory=$true)][string]$CmmId,
[Parameter(Mandatory=$true)][string]$OutDir
)
$ErrorActionPreference = 'Continue'
if (-not (Test-Path -LiteralPath $ConfigPath)) {
Write-Host "ERROR: CSV not found at $ConfigPath"
exit 1
}
try {
$bays = Import-Csv -LiteralPath $ConfigPath
} catch {
Write-Host "ERROR: Failed to parse $ConfigPath - $_"
exit 1
}
$match = $bays | Where-Object { $_.cmm_id -ieq $CmmId }
if (-not $match) {
Write-Host "WARNING: $CmmId not found in bay-config. No version/doda resolution."
exit 0
}
if (-not (Test-Path $OutDir)) {
New-Item -Path $OutDir -ItemType Directory -Force | Out-Null
}
$version = $match.pcdmis_version.Trim()
$doda = $match.doda.Trim().ToLower()
[System.IO.File]::WriteAllText((Join-Path $OutDir 'version.txt'), $version)
[System.IO.File]::WriteAllText((Join-Path $OutDir 'doda.txt'), $doda)
Write-Host "Resolved $CmmId -> PC-DMIS $version, DODA=$doda"
Write-Host " version.txt -> $OutDir\version.txt"
Write-Host " doda.txt -> $OutDir\doda.txt"
exit 0