Lab Workstation: profile-aware Edge homepage + startup tabs
Lab profile in site-config.json now has: edgeHomepage: http://tsgwp00524.logon.ds.ge.com/ edgeStartupTabs: WJ Shop Floor Homepage, M365 Webmail, Shopfloor Dashboard 08-EdgeDefaultBrowser.ps1 now resolves edge config from: pcProfile.edgeStartupTabs > siteConfig.edgeStartupTabs > hardcoded pcProfile.edgeHomepage > first startup tab (existing behavior) This lets different PC types have different Edge configs: Standard-Machine: Plant Apps + Homepage + Dashboard (homepage = Plant Apps) Lab: Homepage + Webmail + Dashboard (homepage = tsgwp00524) Added webmail URL to site-config.json urls section: "webmail": "https://outlook.office365.us/mail" Lab gets no OpenText/UDC/eDNC — already filtered: OpenText + UDC: PCTypes = ["Standard"] in preinstall.json eDNC: Standard/01-eDNC.ps1 (type-specific, never runs for Lab) Office: from PPKG (shared across all shopfloor types) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user