Added option to disable Windows Recall AI snapshots (#61)

Removed code for migrating LastSettings file to SavedSettings
This commit is contained in:
Raphire
2024-06-05 09:17:24 +02:00
parent 6ec319b272
commit ed029df314
6 changed files with 36 additions and 17 deletions

View File

@@ -23,6 +23,7 @@ param (
[switch]$HideSearchTb, [switch]$ShowSearchIconTb, [switch]$ShowSearchLabelTb, [switch]$ShowSearchBoxTb,
[switch]$HideTaskview,
[switch]$DisableCopilot,
[switch]$DisableRecall,
[switch]$DisableWidgets,
[switch]$HideWidgets,
[switch]$DisableChat,
@@ -544,22 +545,9 @@ foreach ($Param in $SPParams) {
}
}
# Check if SavedSettings file exists, if it doesn't exist check if LastSettings file exists
if (Test-Path "$PSScriptRoot/SavedSettings") {
if ([String]::IsNullOrWhiteSpace((Get-content "$PSScriptRoot/SavedSettings"))) {
# Remove SavedSettings file if it's empty
Remove-Item -Path "$PSScriptRoot/SavedSettings" -recurse
}
}
elseif (Test-Path "$PSScriptRoot/LastSettings") {
if ([String]::IsNullOrWhiteSpace((Get-content "$PSScriptRoot/LastSettings"))) {
# Remove LastSettings file if it's empty
Remove-Item -Path "$PSScriptRoot/LastSettings" -recurse
}
else {
# Rename LastSettings file to SavedSettings if it isn't empty
Rename-Item -Path "$PSScriptRoot/LastSettings" -NewName "$PSScriptRoot/SavedSettings"
}
# Remove SavedSettings file if it exists and is empty
if (Test-Path "$PSScriptRoot/SavedSettings" -and [String]::IsNullOrWhiteSpace((Get-content "$PSScriptRoot/SavedSettings"))) {
Remove-Item -Path "$PSScriptRoot/SavedSettings" -recurse
}
# Only run the app selection form if the 'RunAppConfigurator' parameter was passed to the script
@@ -752,6 +740,12 @@ if ((-not $global:Params.Count) -or $RunDefaults -or $RunWin11Defaults -or ($SPP
if ($( Read-Host -Prompt "Disable Windows Copilot? This applies to all users (y/n)" ) -eq 'y') {
AddParameter 'DisableCopilot' 'Disable Windows copilot'
}
Write-Output ""
if ($( Read-Host -Prompt "Disable Windows Recall snapshots? This applies to all users (y/n)" ) -eq 'y') {
AddParameter 'DisableRecall' 'Disable Windows Recall snapshots'
}
}
# Only show this option for Windows 11 users running build 22000 or later
@@ -1131,6 +1125,10 @@ else {
RegImport "> Disabling Windows copilot..." $PSScriptRoot\Regfiles\Disable_Copilot.reg
continue
}
'DisableRecall' {
RegImport "> Disabling Windows Recall snapshots..." $PSScriptRoot\Regfiles\Disable_AI_Recall.reg
continue
}
{$_ -in "HideWidgets", "DisableWidgets"} {
RegImport "> Disabling the widget service and hiding the widget icon from the taskbar..." $PSScriptRoot\Regfiles\Disable_Widgets_Taskbar.reg
continue