From e1a1d28d1266d22c7f57850c33dfc672d3a5094d Mon Sep 17 00:00:00 2001 From: zoicware <118035521+zoicware@users.noreply.github.com> Date: Sun, 2 Nov 2025 20:38:13 -0500 Subject: [PATCH] add other ai policies to disable in region policy set --- RemoveWindowsAi.ps1 | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/RemoveWindowsAi.ps1 b/RemoveWindowsAi.ps1 index 7bbc4fa..68045e4 100644 --- a/RemoveWindowsAi.ps1 +++ b/RemoveWindowsAi.ps1 @@ -513,9 +513,22 @@ function Disable-Copilot-Policies { foreach ($policies in $copilotPolicies) { $policies.defaultState = @('disabled', 'enabled')[$revert] } + $recallPolicies = $jsonContent.policies | Where-Object { $_.'$comment' -like '*A9*' -or $_.'$comment' -like '*Manage Recall*' -or $_.'$comment' -like '*Settings Agent*' } + foreach ($recallPolicy in $recallPolicies) { + if ($recallPolicy.'$comment' -like '*A9*') { + $recallPolicy.defaultState = @('enabled', 'disabled')[$revert] + } + elseif ($recallPolicy.'$comment' -like '*Manage Recall*') { + $recallPolicy.defaultState = @('disabled', 'enabled')[$revert] + } + elseif ($recallPolicy.'$comment' -like '*Settings Agent*') { + $recallPolicy.defaultState = @('enabled', 'disabled')[$revert] + } + } $newJSONContent = $jsonContent | ConvertTo-Json -Depth 100 Set-Content $JSONPath -Value $newJSONContent -Force - Write-Status -msg "$($copilotPolicies.count) CoPilot Policies $(@('Disabled','Enabled')[$revert])" + $total = ($copilotPolicies.count) + ($recallPolicies.count) + Write-Status -msg "$total CoPilot Policies $(@('Disabled','Enabled')[$revert])" } catch { Write-Status -msg 'CoPilot Not Found in IntegratedServicesRegionPolicySet' -errorOutput $true