fix(branding): guard reg unload, set ErrorAction in libs, accent field rename, test hive unload + assertions

This commit is contained in:
sysadmin
2026-06-09 14:23:50 +01:00
parent 6aa963f024
commit 4ff12ab543
5 changed files with 13 additions and 4 deletions

View File

@@ -38,6 +38,7 @@ Describe 'Branding layer writers' {
$k.Manufacturer | Should -Be 'SilverLABS'
$k.Model | Should -Be 'SilverMetal Windows'
$k.SupportURL | Should -Be 'https://silverlabs.uk'
$k.SupportHours | Should -Be '24/7 community + paid SLA'
$k.Logo | Should -Be 'C:\Windows\System32\oemlogo.bmp'
}
@@ -58,6 +59,7 @@ Describe 'Branding layer writers' {
$k = Get-ItemProperty "$script:sw\Policies\Microsoft\FVE"
$k.UseCustomRecoveryMessage | Should -Be 1
$k.RecoveryMessage | Should -Be 'SilverMetal Windows. Locked out? silverlabs.uk'
$k.RecoveryUrl | Should -Be 'https://silverlabs.uk'
}
}
@@ -70,6 +72,7 @@ Describe 'Apply-Branding -Mode Offline' {
foreach ($h in @("$script:mount\Windows\System32\config\SOFTWARE","$script:mount\Users\Default\NTUSER.DAT")) {
reg load 'HKLM\SM_SEED' (New-Item -ItemType File -Force $h | Select-Object -Expand FullName) 2>$null | Out-Null
}
& reg unload 'HKLM\SM_SEED' 2>$null | Out-Null
# The above seed is best-effort; if reg can't init an empty file, the apply
# script creates the hives via reg load of the path it expects.
}