mirror of
https://github.com/zoicware/RemoveWindowsAI.git
synced 2025-12-17 07:06:29 +01:00
add other ai policies to disable in region policy set
This commit is contained in:
@@ -513,9 +513,22 @@ function Disable-Copilot-Policies {
|
|||||||
foreach ($policies in $copilotPolicies) {
|
foreach ($policies in $copilotPolicies) {
|
||||||
$policies.defaultState = @('disabled', 'enabled')[$revert]
|
$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
|
$newJSONContent = $jsonContent | ConvertTo-Json -Depth 100
|
||||||
Set-Content $JSONPath -Value $newJSONContent -Force
|
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 {
|
catch {
|
||||||
Write-Status -msg 'CoPilot Not Found in IntegratedServicesRegionPolicySet' -errorOutput $true
|
Write-Status -msg 'CoPilot Not Found in IntegratedServicesRegionPolicySet' -errorOutput $true
|
||||||
|
|||||||
Reference in New Issue
Block a user