$ErrorActionPreference = 'Stop' $root = Split-Path -Parent $PSScriptRoot $pages = [ordered]@{ 'index.html' = 'home' 'receive.html' = 'receive' 'pallet.html' = 'pallet' 'express-signin.html' = 'express-signin' 'consolidation.html' = 'consolidation' 'pick.html' = 'pick' 'handover.html' = 'handover' 'packing.html' = 'packing' 'relabel.html' = 'relabel' 'exception.html' = 'exception' } foreach ($entry in $pages.GetEnumerator()) { $path = Join-Path $root $entry.Key if (-not (Test-Path -LiteralPath $path -PathType Leaf)) { throw "Missing section page: $($entry.Key)" } $html = Get-Content -Raw -Encoding UTF8 -LiteralPath $path if ($html -notmatch '') { throw "$($entry.Key) is not an HTML document" } if ($html -notmatch "
") { throw "$($entry.Key) does not declare section $($entry.Value)" } if ($html -notmatch '') { throw "$($entry.Key) does not load the shared stylesheet" } if ($html -notmatch '') { throw "$($entry.Key) does not load the shared application script" } } Write-Output "PASS: $($pages.Count) section pages load the shared application assets"