Added option to disable gameDVR, clearing start now backs up old file + more

Added new option to disable Game DVR. (#62)
Clearing the start menu now creates a backup of the current start menu file. (#60)
Fixed unnecessarily setting path variable in Get.ps1 in some situations (#59)
This commit is contained in:
Raphire
2024-05-24 14:13:15 +02:00
parent 9401de8bc7
commit 6ec319b272
5 changed files with 41 additions and 8 deletions

View File

@@ -10,6 +10,7 @@ param (
[switch]$RemoveCommApps,
[switch]$RemoveDevApps,
[switch]$RemoveW11Outlook,
[switch]$DisableDVR,
[switch]$DisableTelemetry,
[switch]$DisableBingSearches, [switch]$DisableBing,
[switch]$DisableLockscrTips, [switch]$DisableLockscreenTips,
@@ -52,15 +53,15 @@ if ((Get-AppxPackage -Name "*Microsoft.DesktopAppInstaller*") -and ((winget -v)
Write-Output "> Installing git..."
winget install git.git --accept-package-agreements --accept-source-agreements --disable-interactivity --no-upgrade
# Add default install location of git to path
$env:Path += ';C:\Program Files\Git\cmd'
Write-Output ""
}
# Navigate to user temp directory
cd $env:TEMP
# Add default install location of git to path
$env:Path += ';C:\Program Files\Git\cmd'
# Download Win11Debloat from github
Write-Output "> Downloading Win11Debloat..."
git clone https://github.com/Raphire/Win11Debloat/

View File

@@ -280,6 +280,7 @@ The quick and advanced method support parameters to tailor the behaviour of the
| -RemoveW11Outlook | Remove the new Outlook for Windows app. |
| -RemoveDevApps | Remove developer-related apps such as Remote Desktop, DevHome and Power Automate. |
| -RemoveGamingApps | Remove the Xbox App and Xbox Gamebar. |
| -DisableDVR | Disable Xbox game DVR. |
| -ClearStart | Remove all pinned apps from the start menu. NOTE: This applies to all existing and new users. (Windows 11 update 22H2 or later only) |
| -DisableTelemetry | Disable telemetry, diagnostic data & targeted ads. |
| -DisableBing | Disable & remove bing search, bing AI & cortana in Windows search. |

7
Regfiles/Disable_DVR.reg Normal file
View File

@@ -0,0 +1,7 @@
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\System\GameConfigStore]
"GameDVR_Enabled"=dword:00000000
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\GameDVR]
"AllowGameDVR"=dword:00000000

View File

@@ -0,0 +1,7 @@
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\System\GameConfigStore]
"GameDVR_Enabled"=dword:00000001
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\GameDVR]
"AllowGameDVR"=dword:00000001

View File

@@ -11,6 +11,7 @@ param (
[switch]$RemoveCommApps,
[switch]$RemoveDevApps,
[switch]$RemoveW11Outlook,
[switch]$DisableDVR,
[switch]$DisableTelemetry,
[switch]$DisableBingSearches, [switch]$DisableBing,
[switch]$DisableLockscrTips, [switch]$DisableLockscreenTips,
@@ -406,9 +407,14 @@ function ClearStartMenu {
# Copy Start menu to all users folders
ForEach ($startmenu in $usersStartMenu) {
$startmenuBinFile = $startmenu.Fullname + "\start2.bin"
$backupBinFile = $startmenuBinFile + ".bak"
# Check if bin file exists
if (Test-Path $startmenuBinFile) {
# Backup current startmenu file
Move-Item -Path $startmenuBinFile -Destination $backupBinFile
# Copy template file
Copy-Item -Path $startmenuTemplate -Destination $startmenu -Force
$cpyMsg = "Replaced start menu for user " + $startmenu.Fullname.Split("\")[2]
@@ -696,11 +702,18 @@ if ((-not $global:Params.Count) -or $RunDefaults -or $RunWin11Defaults -or ($SPP
AddParameter 'RemoveW11Outlook' 'Remove the new Outlook for Windows app'
AddParameter 'RemoveDevApps' 'Remove developer-related apps'
AddParameter 'RemoveGamingApps' 'Remove the Xbox App and Xbox Gamebar'
AddParameter 'DisableDVR' 'Disable Xbox game DVR'
}
'3' {
Write-Output "You have selected $($global:SelectedApps.Count) apps for removal"
AddParameter 'RemoveAppsCustom' "Remove $($global:SelectedApps.Count) apps:"
Write-Output ""
if ($( Read-Host -Prompt "Disable Xbox game DVR? (y/n)" ) -eq 'y') {
AddParameter 'DisableDVR' 'Disable Xbox game DVR'
}
}
}
@@ -721,15 +734,15 @@ if ((-not $global:Params.Count) -or $RunDefaults -or $RunWin11Defaults -or ($SPP
Write-Output ""
if ($( Read-Host -Prompt "Disable & remove bing search, bing AI & cortana in Windows search? (y/n)" ) -eq 'y') {
AddParameter 'DisableBing' 'Disable & remove bing search, bing AI & cortana in Windows search'
if ($( Read-Host -Prompt "Disable tips, tricks, suggestions and ads in start, settings, notifications, explorer and lockscreen? (y/n)" ) -eq 'y') {
AddParameter 'DisableSuggestions' 'Disable tips, tricks, suggestions and ads in start, settings, notifications and Windows explorer'
AddParameter 'DisableLockscreenTips' 'Disable tips & tricks on the lockscreen'
}
Write-Output ""
if ($( Read-Host -Prompt "Disable tips, tricks, suggestions and ads in start, settings, notifications, explorer and lockscreen? (y/n)" ) -eq 'y') {
AddParameter 'DisableSuggestions' 'Disable tips, tricks, suggestions and ads in start, settings, notifications and Windows explorer'
AddParameter 'DisableLockscreenTips' 'Disable tips & tricks on the lockscreen'
if ($( Read-Host -Prompt "Disable & remove bing search, bing AI & cortana in Windows search? (y/n)" ) -eq 'y') {
AddParameter 'DisableBing' 'Disable & remove bing search, bing AI & cortana in Windows search'
}
# Only show this option for Windows 11 users running build 22621 or later
@@ -1055,6 +1068,10 @@ else {
continue
}
'DisableDVR' {
RegImport "> Disabling Xbox game DVR..." $PSScriptRoot\Regfiles\Disable_DVR.reg
continue
}
'ClearStart' {
ClearStartMenu "> Removing all pinned apps from the start menu..."
continue