mirror of
https://github.com/Raphire/Win11Debloat.git
synced 2026-07-03 07:08:27 +00:00
feat(registry): add GPO override warning and WhatIf dry-run previews (#611)
Co-authored-by: Jeffrey <9938813+Raphire@users.noreply.github.com>
This commit is contained in:
@@ -203,6 +203,11 @@ function Invoke-RegistryOperationsFromRegFile {
|
||||
$operations = @(Get-RegFileOperations -regFilePath $RegFilePath)
|
||||
$totalOperations = $operations.Count
|
||||
|
||||
if ($script:Params.ContainsKey("WhatIf")) {
|
||||
Write-Host "[WhatIf] Apply $totalOperations registry changes from '$RegFilePath'" -ForegroundColor Cyan
|
||||
return
|
||||
}
|
||||
|
||||
foreach ($operation in $operations) {
|
||||
try {
|
||||
Invoke-RegistryOperation -Operation $operation -RegFilePath $RegFilePath
|
||||
|
||||
@@ -81,3 +81,4 @@ function Get-RegistryFilePathForFeature {
|
||||
|
||||
return Join-Path $script:RegfilesPath $RegistryKey
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user