Kiosks report their display type; whole-chain DDL parity

This commit is contained in:
2026-08-12 17:07:21 -04:00
parent 50578f33bd
commit d6b433e5f4
3 changed files with 82 additions and 11 deletions

View File

@@ -210,7 +210,8 @@ function New-ShopdbReport {
param([string]$Hostname = $env:COMPUTERNAME,
[Parameter(Mandatory)][string]$Scope,
[int]$AppliedVersion,
[Parameter(Mandatory)][hashtable]$Summary)
[Parameter(Mandatory)][hashtable]$Summary,
[string]$SubType = (Get-ShopdbSubType))
$results = @(foreach ($entry in @($Summary.Results)) {
if ($null -eq $entry) { continue }
$mapped = @{
@@ -230,6 +231,7 @@ function New-ShopdbReport {
scopename = $Scope
appliedversion = $AppliedVersion
enforcerversion = $Summary.EnforcerVersion
subtype = $SubType
counts = @{
installed = [int]$Summary.Installed
skipped = [int]$Summary.Skipped
@@ -240,6 +242,32 @@ function New-ShopdbReport {
}
}
function Get-ShopdbSubType {
<#
.SYNOPSIS
What this PC is WITHIN its scope, read off the machine itself.
.DESCRIPTION
A display knows whether it is a Dashboard, a Lobby screen or the 3D print
room: the dispatcher reads C:\Enrollment\display-type.txt to choose which
page to open. It just never told shopdb, so the fleet table had to guess
from a DashboardDefault fqdn mapping that is empty unless somebody added a
row per kiosk. Reported by the device beats inferred from a lookup table,
the same way enforcerversion already works.
Returns '' when the file is absent - every non-display PC type - so the
report simply carries no subtype rather than a made-up one.
#>
param([string]$Path = 'C:\Enrollment\display-type.txt')
try {
if (-not (Test-Path $Path)) { return '' }
$value = (Get-Content -Path $Path -TotalCount 1 -ErrorAction Stop)
return ([string]$value).Trim()
} catch {
return ''
}
}
function Get-ShopdbPayload {
<#
Fetch a payload blob by content hash over HTTPS, verify the sha256, and
@@ -449,4 +477,4 @@ function ConvertTo-ShopdbSummary {
Export-ModuleMember -Function Get-ShopdbConfig, Sync-ShopdbManifest, `
Compare-ShopdbShadow, Send-ShopdbReport, New-ShopdbReport, Read-CachedVersion, `
Get-ShopdbPayload, Resolve-ShopdbPayloads, Merge-ShopdbManifests, `
ConvertTo-ShopdbSummary
ConvertTo-ShopdbSummary, Get-ShopdbSubType