Currently, if the script fails or encounters an unhandled exception during the execution of debloat parameters, the registry is left in a partially modified, inconsistent state.
This enhancement wraps the execution loop in a try-catch block. If an execution failure occurs, the script automatically loads the pre-execution registry backup (created via New-RegistrySettingsBackup) and restores the registry to its original state, ensuring transactional integrity.
Currently, if the script fails or encounters an unhandled exception during the execution of debloat parameters, the registry is left in a partially modified, inconsistent state.
This enhancement wraps the execution loop in a try-catch block. If an execution failure occurs, the script automatically loads the pre-execution registry backup (created via New-RegistrySettingsBackup) and restores the registry to its original state, ensuring transactional integrity.