Sub-type aware preinstall, USB drivers/PPKGs, Lab OpenText
- PreInstall runner reads pc-subtype.txt and matches PCTypes against both base type (Standard) and composite key (Standard-Machine). - UDC scoped to Standard-Machine only. eDNC and MachineNumberACLs skip on Standard-Timeclock sub-type. - Lab added to OpenText PCTypes. - build-usb.sh copies enrollment/ (PPKGs) and drivers-staging/ (Dell driver packs) onto USB for self-contained deployment. - Playbook deploys PPKGs and drivers from USB to PXE server shares. - Gitignore enrollment/, drivers-staging/, *.ppkg (large binaries). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -86,7 +86,7 @@ if (-not (Test-Path $jsonPath)) {
|
||||
exit 0
|
||||
}
|
||||
|
||||
# --- Read PCTYPE from C:\Enrollment\pc-type.txt (set by startnet.cmd) ---
|
||||
# --- Read PCTYPE and optional PCSUBTYPE from C:\Enrollment\ ---
|
||||
$pcTypeFile = "C:\Enrollment\pc-type.txt"
|
||||
if (-not (Test-Path $pcTypeFile)) {
|
||||
Write-PreInstallLog "No pc-type.txt at $pcTypeFile - skipping" "WARN"
|
||||
@@ -97,7 +97,14 @@ if (-not $pcType) {
|
||||
Write-PreInstallLog "pc-type.txt is empty - skipping" "WARN"
|
||||
exit 0
|
||||
}
|
||||
Write-PreInstallLog "PC type: $pcType"
|
||||
|
||||
$pcSubtype = ''
|
||||
$subtypeFile = "C:\Enrollment\pc-subtype.txt"
|
||||
if (Test-Path $subtypeFile) {
|
||||
$pcSubtype = (Get-Content $subtypeFile -First 1 -ErrorAction SilentlyContinue).Trim()
|
||||
}
|
||||
$pcProfileKey = if ($pcSubtype) { "$pcType-$pcSubtype" } else { $pcType }
|
||||
Write-PreInstallLog "PC type: $pcType$(if ($pcSubtype) { " (subtype: $pcSubtype, profile: $pcProfileKey)" })"
|
||||
|
||||
# --- Parse JSON ---
|
||||
try {
|
||||
@@ -201,11 +208,11 @@ foreach ($app in $config.Applications) {
|
||||
|
||||
Write-PreInstallLog "==> $($app.Name)"
|
||||
|
||||
# Filter by PCTypes
|
||||
# Filter by PCTypes - matches on wildcard, base type, or composite type-subtype key
|
||||
$allowedTypes = @($app.PCTypes)
|
||||
$matchesType = ($allowedTypes -contains "*") -or ($allowedTypes -contains $pcType)
|
||||
$matchesType = ($allowedTypes -contains "*") -or ($allowedTypes -contains $pcType) -or ($pcProfileKey -ne $pcType -and $allowedTypes -contains $pcProfileKey)
|
||||
if (-not $matchesType) {
|
||||
Write-PreInstallLog " PCTypes filter excludes '$pcType' (allowed: $($allowedTypes -join ', ')) - skipping"
|
||||
Write-PreInstallLog " PCTypes filter excludes '$pcProfileKey' (allowed: $($allowedTypes -join ', ')) - skipping"
|
||||
$skipped++
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -1,10 +1,21 @@
|
||||
# 01-eDNC.ps1 - Install eDNC and deploy custom eMxInfo.txt (Standard)
|
||||
# 01-eDNC.ps1 - Install eDNC and deploy custom eMxInfo.txt (Standard-Machine only)
|
||||
|
||||
# --- Transcript ---
|
||||
$logDir = 'C:\Logs\SFLD'
|
||||
if (-not (Test-Path $logDir)) { try { New-Item -ItemType Directory -Path $logDir -Force | Out-Null } catch {} }
|
||||
try { Start-Transcript -Path (Join-Path $logDir '01-eDNC.log') -Append -Force | Out-Null } catch {}
|
||||
|
||||
# --- Skip on Timeclock sub-type ---
|
||||
$subtypeFile = 'C:\Enrollment\pc-subtype.txt'
|
||||
if (Test-Path $subtypeFile) {
|
||||
$subtype = (Get-Content $subtypeFile -First 1 -ErrorAction SilentlyContinue).Trim()
|
||||
if ($subtype -eq 'Timeclock') {
|
||||
Write-Host "=== eDNC Setup: skipped (Standard-Timeclock) ==="
|
||||
try { Stop-Transcript | Out-Null } catch {}
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
Write-Host "=== eDNC Setup ==="
|
||||
|
||||
function Get-SiteConfig {
|
||||
|
||||
@@ -16,6 +16,17 @@ $logDir = 'C:\Logs\SFLD'
|
||||
if (-not (Test-Path $logDir)) { try { New-Item -ItemType Directory -Path $logDir -Force | Out-Null } catch {} }
|
||||
try { Start-Transcript -Path (Join-Path $logDir '02-MachineNumberACLs.log') -Append -Force | Out-Null } catch {}
|
||||
|
||||
# --- Skip on Timeclock sub-type (no UDC/eDNC to grant ACLs for) ---
|
||||
$subtypeFile = 'C:\Enrollment\pc-subtype.txt'
|
||||
if (Test-Path $subtypeFile) {
|
||||
$subtype = (Get-Content $subtypeFile -First 1 -ErrorAction SilentlyContinue).Trim()
|
||||
if ($subtype -eq 'Timeclock') {
|
||||
Write-Host "02-MachineNumberACLs: skipped (Standard-Timeclock)"
|
||||
try { Stop-Transcript | Out-Null } catch {}
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
Write-Host "02-MachineNumberACLs.ps1 starting $(Get-Date -Format 'yyyy-MM-dd HH:mm:ss')"
|
||||
Write-Host "Running as: $([System.Security.Principal.WindowsIdentity]::GetCurrent().Name)"
|
||||
Write-Host ""
|
||||
|
||||
Reference in New Issue
Block a user