From a33a1153949ff8e1c1c4ebef20f6bed9b9a68928 Mon Sep 17 00:00:00 2001 From: cproudlock Date: Thu, 9 Apr 2026 11:19:09 -0400 Subject: [PATCH] Move Monitor-IntuneProgress.ps1 to lib/ - it was hanging the dispatcher Run-ShopfloorSetup.ps1 line 46-47 does: Get-ChildItem -Path $baselineDir -Filter "*.ps1" -File | Sort-Object Name foreach ($script in $scripts) { & $script.FullName } This picks up EVERY *.ps1 in Shopfloor\ and runs it as a baseline script. Last commit (66d13d8) put Monitor-IntuneProgress.ps1 in that same directory, which means the dispatcher was running it as the LAST baseline script (M sorts after 00/04/05). The monitor is an infinite poll loop that never returns until the SFLD lifecycle is complete - so the dispatcher hung there forever, and Standard\01-eDNC.ps1 and Standard\Set-MachineNumber.ps1 never ran. Symptoms in the test run: - 00-PreInstall-MachineApps.ps1 ran (10 installed, 1 OpenText fail) - 04-NetworkAndWinRM.ps1 ran silently - 05-OfficeShortcuts.ps1 ran silently - Monitor-IntuneProgress.ps1 started (Clear-Host + status table) and hung in its main loop - eDNC + Set-MachineNumber never ran Fix: move Monitor-IntuneProgress.ps1 into Shopfloor\lib\ so the dispatcher's non-recursive Get-ChildItem doesn't see it. Update sync_intune.bat's MONITOR path to the new location, and add a comment explaining WHY the monitor lives under lib\ to prevent this mistake from being repeated. Co-Authored-By: Claude Opus 4.6 (1M context) --- .../Shopfloor/{ => lib}/Monitor-IntuneProgress.ps1 | 0 playbook/shopfloor-setup/Shopfloor/sync_intune.bat | 7 ++++++- 2 files changed, 6 insertions(+), 1 deletion(-) rename playbook/shopfloor-setup/Shopfloor/{ => lib}/Monitor-IntuneProgress.ps1 (100%) diff --git a/playbook/shopfloor-setup/Shopfloor/Monitor-IntuneProgress.ps1 b/playbook/shopfloor-setup/Shopfloor/lib/Monitor-IntuneProgress.ps1 similarity index 100% rename from playbook/shopfloor-setup/Shopfloor/Monitor-IntuneProgress.ps1 rename to playbook/shopfloor-setup/Shopfloor/lib/Monitor-IntuneProgress.ps1 diff --git a/playbook/shopfloor-setup/Shopfloor/sync_intune.bat b/playbook/shopfloor-setup/Shopfloor/sync_intune.bat index 3c01bf8..869a54b 100644 --- a/playbook/shopfloor-setup/Shopfloor/sync_intune.bat +++ b/playbook/shopfloor-setup/Shopfloor/sync_intune.bat @@ -18,7 +18,12 @@ REM absolute path to find the monitor instead. setlocal title Intune Policy Sync -set "MONITOR=C:\Enrollment\shopfloor-setup\Shopfloor\Monitor-IntuneProgress.ps1" +REM Monitor lives under lib\ to keep it OUT of the dispatcher's baseline scan. +REM Run-ShopfloorSetup.ps1 does Get-ChildItem -Filter "*.ps1" on the Shopfloor\ +REM dir (non-recursive) and runs every script it finds - if Monitor-IntuneProgress +REM lived there, the dispatcher would invoke it as a baseline script and hang the +REM whole shopfloor setup forever (it's an infinite poll loop, never returns). +set "MONITOR=C:\Enrollment\shopfloor-setup\Shopfloor\lib\Monitor-IntuneProgress.ps1" REM Self-elevate to administrator net session >nul 2>&1