mirror of
https://github.com/zoicware/RemoveWindowsAI.git
synced 2025-12-17 07:06:29 +01:00
disable generative ai in visual assist
This commit is contained in:
@@ -407,6 +407,20 @@ function Disable-Copilot-Policies {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#additional json path for visual assist
|
||||||
|
$visualAssistPath = "$env:windir\SystemApps\MicrosoftWindows.Client.CBS_cw5n1h2txyewy\VisualAssist\VisualAssistActions.json"
|
||||||
|
if (Test-Path $visualAssistPath) {
|
||||||
|
Write-Status -msg "$(@('Disabling','Enabling')[$revert]) Generative AI in Visual Assist..."
|
||||||
|
|
||||||
|
takeown /f $visualAssistPath *>$null
|
||||||
|
icacls $visualAssistPath /grant administrators:F /t *>$null
|
||||||
|
|
||||||
|
$jsoncontent = Get-Content $visualAssistPath | ConvertFrom-Json
|
||||||
|
$jsonContent.actions | Add-Member -MemberType NoteProperty -Name usesGenerativeAI -Value @($false, $true)[$revert] -force
|
||||||
|
$newJSONContent = $jsonContent | ConvertTo-Json -Depth 100
|
||||||
|
Set-Content $visualAssistPath -Value $newJSONContent -Force
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user