fix: improve error handling for registry file imports and telemetry scheduled tasks

This commit is contained in:
Jeffrey
2026-08-22 19:29:54 +02:00
parent c921730703
commit b7f612f36e
5 changed files with 173 additions and 93 deletions
+7
View File
@@ -26,6 +26,13 @@ Describe 'Import-RegistryFile' {
Should -Invoke Invoke-NonBlocking -Times 0 -Exactly
}
It 'returns false when registry file resolution throws' {
Mock Get-RegistryFilePathForFeature { throw 'path resolution failed' }
Import-RegistryFile -message 'Apply' -path 'feature.reg' | Should -BeFalse
Should -Invoke Invoke-NonBlocking -Times 0 -Exactly
}
It 'uses the PowerShell writer only in WhatIf mode' {
$script:Params = @{ WhatIf = $true }
Import-RegistryFile -message 'Apply' -path 'feature.reg' | Should -BeTrue