Auto-apply startup items from profile, Configure-PC -MachineNumberOnly
Three changes to eliminate the redundant startup-item picker during the imaging chain: 06-OrganizeDesktop.ps1 - new Phase 3: auto-apply startup items Reads pcProfile.startupItems (or site-wide default) and creates .lnk files in AllUsers Startup folder. Supports exe, existing, and url types (same as Configure-PC). Idempotent - skips items that already exist so manual changes aren't overwritten. Runs during shopfloor setup finalization, so the tech doesn't need to select startup items again. Configure-PC.ps1 - new -MachineNumberOnly switch When set, skips the entire startup-items section and only shows the machine number prompt (if UDC/eDNC at 9999). Used by sync_intune -AsTask after completion. Full startup picker still available when the tech opens Configure-PC.bat manually from the desktop. Monitor-IntuneProgress.ps1 - simplified -AsTask completion After post-reboot DSC complete: unregisters task, launches Configure-PC -MachineNumberOnly, exits. Tech uses sync_intune.bat on the desktop to see QR code for inventory purposes. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -15,6 +15,13 @@
|
||||
#
|
||||
# Run via Configure-PC.bat on the SupportUser desktop.
|
||||
|
||||
param(
|
||||
# When set, only show the machine number section (skip startup items).
|
||||
# Used by sync_intune -AsTask after completion -- startup items are
|
||||
# already auto-applied by 06-OrganizeDesktop from the PC profile.
|
||||
[switch]$MachineNumberOnly
|
||||
)
|
||||
|
||||
$ErrorActionPreference = 'Continue'
|
||||
|
||||
# --- Transcript logging ---
|
||||
@@ -307,6 +314,9 @@ if ($needsMachineNumber) {
|
||||
}
|
||||
|
||||
# --- Section 2: Startup items + machine-number logon task ---
|
||||
# Skipped when -MachineNumberOnly (called from sync_intune -AsTask after
|
||||
# completion -- startup items already auto-applied by 06-OrganizeDesktop).
|
||||
if (-not $MachineNumberOnly) {
|
||||
Write-Host ""
|
||||
Write-Host " AUTO-STARTUP ITEMS" -ForegroundColor Yellow
|
||||
Write-Host " ----------------------------------------"
|
||||
@@ -423,6 +433,8 @@ if ($selection) {
|
||||
Write-Host " No changes." -ForegroundColor DarkGray
|
||||
}
|
||||
|
||||
} # end if (-not $MachineNumberOnly)
|
||||
|
||||
# --- Summary ---
|
||||
Write-Host ""
|
||||
Write-Host " CURRENT STATE" -ForegroundColor Cyan
|
||||
|
||||
Reference in New Issue
Block a user