Continue or registry failures and show details after execution

This commit is contained in:
Jeffrey
2026-05-19 20:39:14 +02:00
parent 178fc0185f
commit 54b80befee
3 changed files with 17 additions and 2 deletions

View File

@@ -138,6 +138,8 @@ function ExecuteParameter {
# Executes all selected parameters/features
function ExecuteAllChanges {
$script:RegistryImportFailures = 0
# Build list of actionable parameters (skip control params and data-only params)
$actionableKeys = @()
foreach ($paramKey in $script:Params.Keys) {
@@ -216,4 +218,9 @@ function ExecuteAllChanges {
ExecuteParameter -paramKey $paramKey
}
if ($script:RegistryImportFailures -gt 0) {
Write-Host ""
Write-Host "$($script:RegistryImportFailures) registry import change(s) failed. See output above for details." -ForegroundColor Yellow
}
}

View File

@@ -18,6 +18,7 @@ function ImportRegistryFile {
if (-not (Test-Path $regFilePath)) {
$errorMessage = "Unable to find registry file: $path ($regFilePath)"
$script:RegistryImportFailures++
Write-Host "Error: $errorMessage" -ForegroundColor Red
Write-Host ""
throw $errorMessage
@@ -100,9 +101,9 @@ function ImportRegistryFile {
Write-Host ""
}
catch {
$script:RegistryImportFailures++
Write-Host $_.Exception.Message -ForegroundColor Red
Write-Host ""
throw
}
finally {
if ($offlineHiveLoaded) {