diff --git a/playbook/shopfloor-setup/Shopfloor/08-EdgeDefaultBrowser.ps1 b/playbook/shopfloor-setup/Shopfloor/08-EdgeDefaultBrowser.ps1 index 8cf39a3..e920c6d 100644 --- a/playbook/shopfloor-setup/Shopfloor/08-EdgeDefaultBrowser.ps1 +++ b/playbook/shopfloor-setup/Shopfloor/08-EdgeDefaultBrowser.ps1 @@ -196,11 +196,17 @@ function Resolve-StartupUrl { return $null } -# Tab order as requested: Plant Apps, Shop Floor Homepage, Shopfloor Dashboard +# Resolve startup tabs: profile > site-wide > hardcoded fallback +# Different PC types can have different tabs (e.g. Lab has Webmail +# instead of Plant Apps, Standard-Machine has Plant Apps). +$cfgTabs = if ($pcProfile -and $pcProfile.edgeStartupTabs) { $pcProfile.edgeStartupTabs } + elseif ($siteConfig -and $siteConfig.edgeStartupTabs) { $siteConfig.edgeStartupTabs } + else { $null } + $startupTabs = @() -if ($siteConfig -and $siteConfig.edgeStartupTabs) { - foreach ($tab in $siteConfig.edgeStartupTabs) { +if ($cfgTabs) { + foreach ($tab in $cfgTabs) { $fallback = if ($tab.fallbackUrlKey -and $siteConfig.urls) { $siteConfig.urls.$($tab.fallbackUrlKey) } else { '' } $url = Resolve-StartupUrl -BaseName $tab.baseName -Fallback $fallback if ($url) { $startupTabs += $url } @@ -216,6 +222,10 @@ if ($siteConfig -and $siteConfig.edgeStartupTabs) { if ($dashboard) { $startupTabs += $dashboard } } +# Resolve homepage: profile can override (e.g. Lab has a different homepage +# than Standard). Falls back to the first startup tab if not specified. +$edgeHomepage = if ($pcProfile -and $pcProfile.edgeHomepage) { $pcProfile.edgeHomepage } else { $null } + if ($startupTabs.Count -eq 0) { Write-Warning "No startup tab URLs resolved - skipping Edge startup config." } else { @@ -241,8 +251,10 @@ if ($startupTabs.Count -eq 0) { Set-ItemProperty -Path $urlsKey -Name $name -Value $startupTabs[$i] -Type String -Force } - # Homepage = the first startup tab. Home button opens it, not NTP. - Set-ItemProperty -Path $edgePolKey -Name 'HomepageLocation' -Value $startupTabs[0] -Type String -Force + # Homepage: profile override > first startup tab. Home button opens it, not NTP. + $homepageUrl = if ($edgeHomepage) { $edgeHomepage } else { $startupTabs[0] } + Write-Host "Homepage set to: $homepageUrl" + Set-ItemProperty -Path $edgePolKey -Name 'HomepageLocation' -Value $homepageUrl -Type String -Force Set-ItemProperty -Path $edgePolKey -Name 'HomepageIsNewTabPage' -Value 0 -Type DWord -Force Set-ItemProperty -Path $edgePolKey -Name 'ShowHomeButton' -Value 1 -Type DWord -Force diff --git a/playbook/shopfloor-setup/site-config.json b/playbook/shopfloor-setup/site-config.json index 14a969e..1bdfe06 100644 --- a/playbook/shopfloor-setup/site-config.json +++ b/playbook/shopfloor-setup/site-config.json @@ -9,7 +9,8 @@ "urls": { "plantApps": "https://mes-wjefferson.apps.lr.geaerospace.net/run/?app_name=Plant%20Applications", "shopFloorHomepage": "http://tsgwp00524.logon.ds.ge.com/", - "shopfloorDashboard": "https://tsgwp00525.wjs.geaerospace.net/shopdb/shopfloor-dashboard/" + "shopfloorDashboard": "https://tsgwp00525.wjs.geaerospace.net/shopdb/shopfloor-dashboard/", + "webmail": "https://outlook.office365.us/mail" }, "edgeStartupTabs": [ @@ -147,12 +148,18 @@ }, "Lab": { - "_comment": "No applications, minimal startup", + "_comment": "Lab Workstation - Office from ppkg, web URLs, custom Edge homepage + tabs", "startupItems": [], "taskbarPins": [ { "name": "Microsoft Edge", "lnkPath": "%ALLUSERSPROFILE%\\Microsoft\\Windows\\Start Menu\\Programs\\Microsoft Edge.lnk" } ], - "desktopApps": [] + "desktopApps": [], + "edgeHomepage": "http://tsgwp00524.logon.ds.ge.com/", + "edgeStartupTabs": [ + { "baseName": "WJ Shop Floor Homepage", "fallbackUrlKey": "shopFloorHomepage" }, + { "baseName": "M365 Webmail", "fallbackUrlKey": "webmail" }, + { "baseName": "Shopfloor Dashboard", "fallbackUrlKey": "shopfloorDashboard" } + ] }, "Display-Lobby": {