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
@@ -11,6 +11,9 @@ Describe 'Convert-RegistryValueKindFromBackup' {
It '<Case>' -ForEach @(
@{ Case = 'parses registry kinds case-insensitively'; KindName = 'dword'; Expected = [Microsoft.Win32.RegistryValueKind]::DWord; ExpectedError = $null }
@{ Case = 'rejects an invalid registry kind'; KindName = 'NotARegistryValueKind'; Expected = $null; ExpectedError = 'Unsupported registry value kind in backup: NotARegistryValueKind' }
@{ Case = 'rejects an undefined numeric kind'; KindName = '99'; Expected = $null; ExpectedError = 'Unsupported registry value kind in backup: 99' }
@{ Case = 'rejects Unknown'; KindName = 'Unknown'; Expected = $null; ExpectedError = 'Unsupported registry value kind in backup: Unknown' }
@{ Case = 'rejects None'; KindName = 'None'; Expected = $null; ExpectedError = 'Unsupported registry value kind in backup: None' }
) {
if ($ExpectedError) {
{ Convert-RegistryValueKindFromBackup -KindName $KindName } | Should -Throw $ExpectedError