diff --git a/Win11Debloat.ps1 b/Win11Debloat.ps1 index 42a6e74..a191ebe 100644 --- a/Win11Debloat.ps1 +++ b/Win11Debloat.ps1 @@ -545,12 +545,15 @@ function RegImport { # Restart the Windows Explorer process function RestartExplorer { + if ($global:Params.ContainsKey("Sysprep")) { + return + } + Write-Output "> Restarting Windows Explorer process to apply all changes... (This may cause some flickering)" - # Only restart if the powershell process matches the OS architecture + # Only restart if the powershell process matches the OS architecture. # Restarting explorer from a 32bit Powershell window will fail on a 64bit OS - if ([Environment]::Is64BitProcess -eq [Environment]::Is64BitOperatingSystem) - { + if ([Environment]::Is64BitProcess -eq [Environment]::Is64BitOperatingSystem) { Stop-Process -processName: Explorer -Force } else {