PC profiles: per-type/sub-type config + Standard Timeclock/Machine menu
Adds a pcProfiles section to site-config.json that lets each PC type (and
optional sub-type) override startupItems, taskbarPins, and desktopApps.
Scripts resolve: pcProfile > site-wide default > hardcoded fallback.
New shared helper: Shopfloor/lib/Get-PCProfile.ps1
Dot-sourced by consuming scripts. Reads pc-type.txt + pc-subtype.txt,
builds a profile key (e.g. "Standard-Machine"), and looks it up in
site-config.json pcProfiles. Exports $siteConfig, $pcType, $pcSubtype,
$profileKey, $pcProfile for the caller to use.
Replaces the inline Get-SiteConfig function that was copy-pasted into
each script. Scripts now do:
. "$PSScriptRoot\lib\Get-PCProfile.ps1"
instead of duplicating the loader.
startnet.cmd changes:
- Added Lab as PC type option (7)
- Standard now has a sub-type menu: Timeclock / Machine
- Display sub-type menu also writes PCSUBTYPE for consistency
- pc-subtype.txt written alongside pc-type.txt when sub-type selected
- site-config.json copied from enrollment share to W:\Enrollment\
site-config.json v2.0:
- New pcProfiles section with profiles for:
Standard-Timeclock, Standard-Machine, CMM, Genspect, Keyence,
WaxAndTrace, Lab, Display-Lobby, Display-Dashboard
- CMM/Genspect/Keyence/WaxAndTrace profiles have TODO comments for
type-specific apps (placeholder with WJ Shopfloor baseline only)
- Lab/Display profiles have empty startupItems and desktopApps
- Top-level startupItems/taskbarPins/desktopApps remain as site-wide
defaults (used when no profile matches)
Updated scripts:
06-OrganizeDesktop.ps1 - desktopApps from profile > site > hardcoded
07-TaskbarLayout.ps1 - taskbarPins from profile > site > hardcoded
08-EdgeDefaultBrowser.ps1 - uses shared profile loader
Configure-PC.ps1 - startupItems from profile > site > hardcoded
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -87,19 +87,44 @@ echo 3. Keyence
|
||||
echo 4. Genspect
|
||||
echo 5. Display
|
||||
echo 6. Standard
|
||||
echo 7. Lab
|
||||
echo.
|
||||
set PCTYPE=
|
||||
set /p pctype_choice=Enter your choice (1-6):
|
||||
set /p pctype_choice=Enter your choice (1-7):
|
||||
if "%pctype_choice%"=="1" set PCTYPE=CMM
|
||||
if "%pctype_choice%"=="2" set PCTYPE=WaxAndTrace
|
||||
if "%pctype_choice%"=="3" set PCTYPE=Keyence
|
||||
if "%pctype_choice%"=="4" set PCTYPE=Genspect
|
||||
if "%pctype_choice%"=="5" set PCTYPE=Display
|
||||
if "%pctype_choice%"=="6" set PCTYPE=Standard
|
||||
if "%pctype_choice%"=="7" set PCTYPE=Lab
|
||||
if "%PCTYPE%"=="" goto pctype_menu
|
||||
|
||||
REM --- Display sub-type selection ---
|
||||
REM --- Sub-type selection menus ---
|
||||
REM PCSUBTYPE is written to pc-subtype.txt alongside pc-type.txt.
|
||||
REM Scripts read it to look up the right profile in site-config.json.
|
||||
set PCSUBTYPE=
|
||||
set DISPLAYTYPE=
|
||||
|
||||
REM --- Standard sub-type ---
|
||||
if not "%PCTYPE%"=="Standard" goto skip_standard_menu
|
||||
:standard_menu
|
||||
cls
|
||||
echo.
|
||||
echo ========================================
|
||||
echo Standard PC Sub-Type
|
||||
echo ========================================
|
||||
echo.
|
||||
echo 1. Timeclock (WJ Shopfloor only)
|
||||
echo 2. Machine (WJ Shopfloor, Plant Apps, eDNC, UDC)
|
||||
echo.
|
||||
set /p standard_choice=Enter your choice (1-2):
|
||||
if "%standard_choice%"=="1" set PCSUBTYPE=Timeclock
|
||||
if "%standard_choice%"=="2" set PCSUBTYPE=Machine
|
||||
if "%PCSUBTYPE%"=="" goto standard_menu
|
||||
:skip_standard_menu
|
||||
|
||||
REM --- Display sub-type ---
|
||||
if not "%PCTYPE%"=="Display" goto skip_display_menu
|
||||
:display_menu
|
||||
cls
|
||||
@@ -113,8 +138,10 @@ echo 2. Dashboard
|
||||
echo.
|
||||
set /p display_choice=Enter your choice (1-2):
|
||||
if "%display_choice%"=="1" set DISPLAYTYPE=Lobby
|
||||
if "%display_choice%"=="1" set PCSUBTYPE=Lobby
|
||||
if "%display_choice%"=="2" set DISPLAYTYPE=Dashboard
|
||||
if "%DISPLAYTYPE%"=="" goto display_menu
|
||||
if "%display_choice%"=="2" set PCSUBTYPE=Dashboard
|
||||
if "%PCSUBTYPE%"=="" goto display_menu
|
||||
:skip_display_menu
|
||||
|
||||
REM --- Map enrollment share early (kept open for copy after imaging) ---
|
||||
@@ -251,6 +278,7 @@ REM --- Copy shopfloor PC type setup scripts ---
|
||||
if "%PCTYPE%"=="" goto cleanup_enroll
|
||||
echo %PCTYPE%> W:\Enrollment\pc-type.txt
|
||||
if not "%DISPLAYTYPE%"=="" echo %DISPLAYTYPE%> W:\Enrollment\display-type.txt
|
||||
if not "%PCSUBTYPE%"=="" echo %PCSUBTYPE%> W:\Enrollment\pc-subtype.txt
|
||||
copy /Y "Y:\shopfloor-setup\Run-ShopfloorSetup.ps1" "W:\Enrollment\Run-ShopfloorSetup.ps1"
|
||||
REM --- Always copy Shopfloor baseline scripts ---
|
||||
mkdir W:\Enrollment\shopfloor-setup 2>NUL
|
||||
|
||||
Reference in New Issue
Block a user