Improve backup validation (#849)

This commit is contained in:
Jeffrey
2026-10-21 22:47:01 +02:00
committed by GitHub
parent 97f3f805ef
commit 039ef80a8b
18 changed files with 1504 additions and 46 deletions
@@ -15,6 +15,7 @@ Describe 'Test-RegistryBackupMatchesSelectedFeatures' {
ApplyFeature = [PSCustomObject]@{ RegistryKey = 'apply.reg'; RegistryUndoKey = 'undo.reg' }
}
$script:CapturePlanCalls = [System.Collections.Generic.List[bool]]::new()
Mock Get-RegistryBackupTrustedValueMap { @{} }
Mock Get-RegistryBackupCapturePlans {
param($SelectedRegistryFeatures, $UndoRegistryFeatures, $UseSysprepRegFiles)
$script:CapturePlanCalls.Add([bool]$UseSysprepRegFiles)
@@ -30,6 +31,7 @@ Describe 'Test-RegistryBackupMatchesSelectedFeatures' {
It 'derives an allow list from selected features and accepts a matching snapshot' {
$snapshot = [PSCustomObject]@{
Path = 'HKEY_CURRENT_USER\Software\Example'
Exists = $true
Values = @([PSCustomObject]@{ Name = 'Enabled'; Exists = $true; Kind = 'DWord'; Data = 1 })
SubKeys = @()
}