From 3f2d42fa3fcfa84d44d8b5d4e2991cc3c94c27a1 Mon Sep 17 00:00:00 2001 From: CodingWonders <101426328+CodingWonders@users.noreply.github.com> Date: Thu, 19 Dec 2024 19:17:31 +0100 Subject: [PATCH] Add detections for expedited app removal They only affect 24H2 and newer. Earlier releases don't have these expedited apps --- functions/microwin/Invoke-Microwin.ps1 | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/functions/microwin/Invoke-Microwin.ps1 b/functions/microwin/Invoke-Microwin.ps1 index 1d012613..8f0b2073 100644 --- a/functions/microwin/Invoke-Microwin.ps1 +++ b/functions/microwin/Invoke-Microwin.ps1 @@ -285,20 +285,22 @@ public class PowerManagement { reg add "HKLM\zSYSTEM\Setup\LabConfig" /v "BypassTPMCheck" /t REG_DWORD /d 1 /f reg add "HKLM\zSYSTEM\Setup\MoSetup" /v "AllowUpgradesWithUnsupportedTPMOrCPU" /t REG_DWORD /d 1 /f - # Prevent Windows Update Installing so called Expedited Apps - @( - 'EdgeUpdate', - 'DevHomeUpdate', - 'OutlookUpdate', - 'CrossDeviceUpdate' - ) | ForEach-Object { - Write-Host "Removing Windows Expedited App: $_" + # Prevent Windows Update Installing so called Expedited Apps - 24H2 and newer + if ((Microwin-TestCompatibleImage $imgVersion $([System.Version]::new(10,0,26100,1))) -eq $true) { + @( + 'EdgeUpdate', + 'DevHomeUpdate', + 'OutlookUpdate', + 'CrossDeviceUpdate' + ) | ForEach-Object { + Write-Host "Removing Windows Expedited App: $_" - # Copied here After Installation (Online) - # reg delete "HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Orchestrator\UScheduler\$_" /f | Out-Null + # Copied here After Installation (Online) + # reg delete "HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Orchestrator\UScheduler\$_" /f | Out-Null - # When in Offline Image - reg delete "HKLM\zSOFTWARE\Microsoft\WindowsUpdate\Orchestrator\UScheduler_Oobe\$_" /f | Out-Null + # When in Offline Image + reg delete "HKLM\zSOFTWARE\Microsoft\WindowsUpdate\Orchestrator\UScheduler_Oobe\$_" /f | Out-Null + } } reg add "HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\Search" /v "SearchboxTaskbarMode" /t REG_DWORD /d 0 /f