Em dashes (U+2014) and arrows (U+2192) break PowerShell 5.1 on Windows when the file has no UTF-8 BOM -- byte 0x94 gets read as a right double quote in Windows-1252, silently closing strings mid-parse. This caused run-enrollment.ps1 to fail on PXE-imaged machines with "string is missing the terminator" at line 113. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
46 lines
1.5 KiB
PowerShell
46 lines
1.5 KiB
PowerShell
# 01-Setup-Display.ps1 -- Display-specific setup (runs after Shopfloor baseline)
|
|
# Reads display-type.txt to install either LobbyDisplay or Dashboard kiosk app.
|
|
|
|
$enrollDir = "C:\Enrollment"
|
|
$typeFile = Join-Path $enrollDir "display-type.txt"
|
|
$setupDir = Split-Path -Parent $MyInvocation.MyCommand.Path
|
|
|
|
if (-not (Test-Path $typeFile)) {
|
|
Write-Warning "No display-type.txt found - skipping display setup."
|
|
return
|
|
}
|
|
|
|
$displayType = (Get-Content $typeFile -First 1).Trim()
|
|
Write-Host "=== Display Setup: $displayType ==="
|
|
|
|
switch ($displayType) {
|
|
"Lobby" {
|
|
$installer = Join-Path $setupDir "GEAerospaceLobbyDisplaySetup.exe"
|
|
$appName = "Lobby Display"
|
|
}
|
|
"Dashboard" {
|
|
$installer = Join-Path $setupDir "GEAerospaceDashboardSetup.exe"
|
|
$appName = "Dashboard"
|
|
}
|
|
default {
|
|
Write-Warning "Unknown display type: $displayType"
|
|
return
|
|
}
|
|
}
|
|
|
|
if (-not (Test-Path $installer)) {
|
|
Write-Warning "$appName installer not found at $installer - skipping."
|
|
return
|
|
}
|
|
|
|
Write-Host "Installing $appName..."
|
|
$proc = Start-Process -FilePath $installer -ArgumentList '/VERYSILENT', '/SUPPRESSMSGBOXES', '/NORESTART', "/LOG=C:\Enrollment\$appName-install.log" -Wait -PassThru
|
|
|
|
if ($proc.ExitCode -eq 0) {
|
|
Write-Host "$appName installed successfully."
|
|
} else {
|
|
Write-Warning "$appName exited with code $($proc.ExitCode). Check C:\Enrollment\$appName-install.log"
|
|
}
|
|
|
|
Write-Host "=== Display Setup Complete ==="
|