From 1e3ee8f452927b5963b1628c40fa05267fd198f5 Mon Sep 17 00:00:00 2001 From: zoicware <118035521+zoicware@users.noreply.github.com> Date: Tue, 24 Jun 2025 21:57:25 -0400 Subject: [PATCH] Recall Optional Feature Check --- RemoveWindowsAi.ps1 | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/RemoveWindowsAi.ps1 b/RemoveWindowsAi.ps1 index 0c2f9ee..3851ecb 100644 --- a/RemoveWindowsAi.ps1 +++ b/RemoveWindowsAi.ps1 @@ -356,15 +356,18 @@ foreach ($path in $eolKeys) { } #remove recall optional feature -$ProgressPreference = 'SilentlyContinue' -try { - Write-Status -msg 'Removing Recall Optional Feature...' - Disable-WindowsOptionalFeature -Online -FeatureName 'Recall' -Remove -NoRestart -ErrorAction Stop *>$null +Write-Status -msg 'Removing Recall Optional Feature...' +$state = (Get-WindowsOptionalFeature -Online -FeatureName 'Recall').State +if ($state -and $state -ne 'DisabledWithPayloadRemoved') { + $ProgressPreference = 'SilentlyContinue' + try { + Disable-WindowsOptionalFeature -Online -FeatureName 'Recall' -Remove -NoRestart -ErrorAction Stop *>$null + } + catch { + #hide error + } + } -catch { - #hide error -} - Write-Status -msg 'Removing Appx Package Files...' #-----------------------------------------------------------------------remove files