mirror of
https://github.com/Raphire/Win11Debloat.git
synced 2026-07-02 22:58:34 +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:
@@ -221,6 +221,15 @@ else {
|
||||
Start-Transcript -Path $script:DefaultLogPath -Append -IncludeInvocationHeader -Force | Out-Null
|
||||
}
|
||||
|
||||
# Check if the device is domain-joined and warn the user (Group Policy may override changes)
|
||||
try {
|
||||
$computerSystem = Get-CimInstance Win32_ComputerSystem -ErrorAction SilentlyContinue
|
||||
if ($null -ne $computerSystem -and $computerSystem.PartOfDomain) {
|
||||
Write-Warning "This machine is domain-joined. Group Policy may override changes made by Win11Debloat."
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
|
||||
# Check if script has all required files
|
||||
if (-not ((Test-Path $script:DefaultSettingsFilePath) -and (Test-Path $script:AppsListFilePath) -and (Test-Path $script:RegfilesPath) -and (Test-Path $script:AssetsPath) -and (Test-Path $script:AppSelectionSchema) -and (Test-Path $script:ApplyChangesWindowSchema) -and (Test-Path $script:SharedStylesSchema) -and (Test-Path $script:BubbleHintSchema) -and (Test-Path $script:RestoreBackupWindowSchema) -and (Test-Path $script:FeaturesFilePath))) {
|
||||
Write-Error "Win11Debloat is unable to find required files, please ensure all script files are present"
|
||||
@@ -494,7 +503,11 @@ if ((-not $script:Params.Count) -or $RunDefaults -or $RunDefaultsLite -or $RunSa
|
||||
try {
|
||||
$result = Show-MainWindow
|
||||
|
||||
Stop-Transcript
|
||||
try {
|
||||
Stop-Transcript
|
||||
}
|
||||
catch { }
|
||||
|
||||
Exit
|
||||
}
|
||||
catch {
|
||||
|
||||
Reference in New Issue
Block a user