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

@@ -22,6 +22,7 @@ param (
[switch]$HideSearchTb, [switch]$ShowSearchIconTb, [switch]$ShowSearchLabelTb, [switch]$ShowSearchBoxTb, [switch]$HideSearchTb, [switch]$ShowSearchIconTb, [switch]$ShowSearchLabelTb, [switch]$ShowSearchBoxTb,
[switch]$HideTaskview, [switch]$HideTaskview,
[switch]$DisableCopilot, [switch]$DisableCopilot,
[switch]$DisableRecall,
[switch]$DisableWidgets, [switch]$DisableWidgets,
[switch]$HideWidgets, [switch]$HideWidgets,
[switch]$DisableChat, [switch]$DisableChat,

View File

@@ -28,6 +28,7 @@ through all the settings yourself, or removing apps one by one!
- Disable & remove bing search & cortana in Windows search. - Disable & remove bing search & cortana in Windows search.
- Disable tips, tricks, suggestions and ads in start, settings, notifications, windows explorer, and on the lockscreen. - Disable tips, tricks, suggestions and ads in start, settings, notifications, windows explorer, and on the lockscreen.
- Disable Windows Copilot. (Windows 11 build 22621+) - Disable Windows Copilot. (Windows 11 build 22621+)
- Disable Windows Recall snapshots. (Windows 11 build 22621+)
- Restore the old Windows 10 style context menu. (Windows 11 build 22000+) - Restore the old Windows 10 style context menu. (Windows 11 build 22000+)
- Show hidden files, folders and drives. - Show hidden files, folders and drives.
- Show file extensions for known file types. - Show file extensions for known file types.

View File

@@ -23,9 +23,10 @@ You can pick and choose exactly which modifications you want the script to make,
- Disable telemetry, diagnostic data, app-launch tracking & targeted ads. - Disable telemetry, diagnostic data, app-launch tracking & targeted ads.
- Disable tips, tricks, suggestions and ads in start, settings, notifications, Windows explorer, and on the lockscreen. - Disable tips, tricks, suggestions and ads in start, settings, notifications, Windows explorer, and on the lockscreen.
#### Bing & Copilot #### Bing, Copilot & More
- Disable & remove bing search & cortana in Windows search. - Disable & remove bing search & cortana in Windows search.
- Disable Windows Copilot. (Windows 11 only) - Disable Windows Copilot. (Windows 11 only)
- Disable Windows Recall snapshots. (Windows 11 only)
#### Windows Explorer #### Windows Explorer
- Show hidden files, folders and drives. - Show hidden files, folders and drives.
@@ -297,6 +298,7 @@ The quick and advanced method support parameters to tailor the behaviour of the
| -ShowSearchBoxTb | Show search box on the taskbar. (Windows 11 only) | | -ShowSearchBoxTb | Show search box on the taskbar. (Windows 11 only) |
| -HideTaskview | Hide the taskview button from the taskbar. (Windows 11 only) | | -HideTaskview | Hide the taskview button from the taskbar. (Windows 11 only) |
| -DisableCopilot | Disable Windows copilot. (Windows 11 only) | | -DisableCopilot | Disable Windows copilot. (Windows 11 only) |
| -DisableRecall | Disable Windows Recall snapshots. (Windows 11 only) |
| -DisableWidgets | Disable the widget service & hide the widget (news and interests) icon from the taskbar. | | -DisableWidgets | Disable the widget service & hide the widget (news and interests) icon from the taskbar. |
| -HideChat | Hide the chat (meet now) icon from the taskbar. | | -HideChat | Hide the chat (meet now) icon from the taskbar. |
| -HideOnedrive | Hide the onedrive folder in the Windows explorer sidepanel. (Windows 10 only) | | -HideOnedrive | Hide the onedrive folder in the Windows explorer sidepanel. (Windows 10 only) |

View File

@@ -0,0 +1,7 @@
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\WindowsAI]
"DisableAIDataAnalysis"=dword:00000001
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsAI]
"DisableAIDataAnalysis"=dword:00000001

View File

@@ -0,0 +1,10 @@
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PolicyManager\default\WindowsAI\DisableAIDataAnalysis]
"value"=dword:00000000
[HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\WindowsAI]
"DisableAIDataAnalysis"=-
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsAI]
"DisableAIDataAnalysis"=-

View File

@@ -23,6 +23,7 @@ param (
[switch]$HideSearchTb, [switch]$ShowSearchIconTb, [switch]$ShowSearchLabelTb, [switch]$ShowSearchBoxTb, [switch]$HideSearchTb, [switch]$ShowSearchIconTb, [switch]$ShowSearchLabelTb, [switch]$ShowSearchBoxTb,
[switch]$HideTaskview, [switch]$HideTaskview,
[switch]$DisableCopilot, [switch]$DisableCopilot,
[switch]$DisableRecall,
[switch]$DisableWidgets, [switch]$DisableWidgets,
[switch]$HideWidgets, [switch]$HideWidgets,
[switch]$DisableChat, [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 # Remove SavedSettings file if it exists and is empty
if (Test-Path "$PSScriptRoot/SavedSettings") { if (Test-Path "$PSScriptRoot/SavedSettings" -and [String]::IsNullOrWhiteSpace((Get-content "$PSScriptRoot/SavedSettings"))) {
if ([String]::IsNullOrWhiteSpace((Get-content "$PSScriptRoot/SavedSettings"))) { Remove-Item -Path "$PSScriptRoot/SavedSettings" -recurse
# 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"
}
} }
# Only run the app selection form if the 'RunAppConfigurator' parameter was passed to the script # 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') { if ($( Read-Host -Prompt "Disable Windows Copilot? This applies to all users (y/n)" ) -eq 'y') {
AddParameter 'DisableCopilot' 'Disable Windows copilot' 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 # 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 RegImport "> Disabling Windows copilot..." $PSScriptRoot\Regfiles\Disable_Copilot.reg
continue continue
} }
'DisableRecall' {
RegImport "> Disabling Windows Recall snapshots..." $PSScriptRoot\Regfiles\Disable_AI_Recall.reg
continue
}
{$_ -in "HideWidgets", "DisableWidgets"} { {$_ -in "HideWidgets", "DisableWidgets"} {
RegImport "> Disabling the widget service and hiding the widget icon from the taskbar..." $PSScriptRoot\Regfiles\Disable_Widgets_Taskbar.reg RegImport "> Disabling the widget service and hiding the widget icon from the taskbar..." $PSScriptRoot\Regfiles\Disable_Widgets_Taskbar.reg
continue continue