Files
Win11Debloat/Scripts/Features/BackupRegistryFeatureSelection.ps1
Jeffrey 2c360961e3 Add registry backup & restore (#566)
Starting from this commit, Win11Debloat will automatically create a registry backup every time the script is run. This registry backup can be used to revert any registry changes made by the script.
2026-05-08 21:19:52 +02:00

23 lines
501 B
PowerShell

function Get-FeatureId {
param(
[Parameter(Mandatory)]
$Feature
)
$featureId = [string]$Feature.FeatureId
if ([string]::IsNullOrWhiteSpace($featureId)) {
throw 'Selected feature is missing required FeatureId.'
}
return $featureId
}
function Get-RegistryBackedFeatures {
param(
[Parameter(Mandatory)]
[object[]]$Features
)
return @($Features | Where-Object { -not [string]::IsNullOrWhiteSpace([string]$_.RegistryKey) })
}