mirror of
https://github.com/Raphire/Win11Debloat.git
synced 2026-08-23 08:02:07 +00:00
Introduced new Sysprep feature (#81)
Allows users to apply script before account creation. All changes are applied to default user account template.
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
param (
|
param (
|
||||||
[switch]$Silent,
|
[switch]$Silent,
|
||||||
|
[switch]$Sysprep,
|
||||||
[switch]$RunAppConfigurator,
|
[switch]$RunAppConfigurator,
|
||||||
[switch]$RunDefaults, [switch]$RunWin11Defaults,
|
[switch]$RunDefaults, [switch]$RunWin11Defaults,
|
||||||
[switch]$RemoveApps,
|
[switch]$RemoveApps,
|
||||||
|
|||||||
+7
-8
@@ -23,21 +23,20 @@ through all the settings yourself, or removing apps one by one!
|
|||||||
Using the custom mode you can
|
Using the custom mode you can
|
||||||
-------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------
|
||||||
- Remove bloatware apps, with the option to select exactly what apps to remove or keep.
|
- Remove bloatware apps, with the option to select exactly what apps to remove or keep.
|
||||||
- Remove all pinned apps from the start menu. This applies to all existing and new users. (Windows 11 build 22621+)
|
- Remove all pinned apps from the start menu for the current user, or for all existing and new users. (Windows 11 only)
|
||||||
- Disable telemetry, diagnostic data, app-launch tracking & targeted ads.
|
- Disable telemetry, diagnostic data, app-launch tracking & targeted ads.
|
||||||
- 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 only)
|
||||||
- Disable Windows Recall snapshots. (Windows 11 build 22621+)
|
- Disable Windows Recall snapshots. (Windows 11 only)
|
||||||
- Restore the old Windows 10 style context menu. (Windows 11 build 22000+)
|
- Restore the old Windows 10 style context menu. (Windows 11 only)
|
||||||
- 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.
|
||||||
- Hide duplicate removable drive entries from the windows explorer sidepane, so only the entry under 'This PC' remains.
|
- Hide duplicate removable drive entries from the windows explorer sidepane, so only the entry under 'This PC' remains.
|
||||||
- Align taskbar icons to the left. (Windows 11 build 22000+)
|
- Align taskbar icons to the left. (Windows 11 only)
|
||||||
- Hide or change the search icon/box on the taskbar. (Windows 11 build 22000+)
|
- Hide or change the search icon/box on the taskbar. (Windows 11 only)
|
||||||
- Hide the taskview button from the taskbar. (Windows 11 build 22000+)
|
- Hide the taskview button from the taskbar. (Windows 11 only)
|
||||||
- Disable the widget service & hide the icon from the taskbar.
|
- Disable the widget service & hide the icon from the taskbar.
|
||||||
- Hide the chat (meet now) icon from the taskbar. (Up to build 22621)
|
|
||||||
- Hide the 3D objects, music or onedrive folder in the windows explorer sidepanel. (Windows 10 only)
|
- Hide the 3D objects, music or onedrive folder in the windows explorer sidepanel. (Windows 10 only)
|
||||||
- Hide the 'Include in library', 'Give access to' and 'Share' options in the context menu. (Windows 10 only)
|
- Hide the 'Include in library', 'Give access to' and 'Share' options in the context menu. (Windows 10 only)
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ You can pick and choose exactly which modifications you want the script to make,
|
|||||||
|
|
||||||
#### App Removal
|
#### App Removal
|
||||||
- Remove a wide variety of bloatware apps, with the option to select exactly what apps to remove and keep.
|
- Remove a wide variety of bloatware apps, with the option to select exactly what apps to remove and keep.
|
||||||
- Remove all pinned apps from the start menu. NOTE: This applies to all existing and new users. (Windows 11 only)
|
- Remove all pinned apps from the start menu for the current user, or for all existing and new users. (Windows 11 only)
|
||||||
|
|
||||||
#### Telemetry & Suggested Content
|
#### Telemetry & Suggested Content
|
||||||
- Disable telemetry, diagnostic data, app-launch tracking & targeted ads.
|
- Disable telemetry, diagnostic data, app-launch tracking & targeted ads.
|
||||||
@@ -45,6 +45,9 @@ You can pick and choose exactly which modifications you want the script to make,
|
|||||||
- Hide the 3D objects, music or onedrive folder in the Windows explorer sidepanel. (Windows 10 only)
|
- Hide the 3D objects, music or onedrive folder in the Windows explorer sidepanel. (Windows 10 only)
|
||||||
- Hide the 'Include in library', 'Give access to' and 'Share' options in the context menu. (Windows 10 only)
|
- Hide the 'Include in library', 'Give access to' and 'Share' options in the context menu. (Windows 10 only)
|
||||||
|
|
||||||
|
#### Advanced Features
|
||||||
|
- Sysprep mode to apply changes to the Windows Default user profile.
|
||||||
|
|
||||||
## Default Mode
|
## Default Mode
|
||||||
|
|
||||||
The default mode applies the changes that are recommended for most users, expand the section below for more info.
|
The default mode applies the changes that are recommended for most users, expand the section below for more info.
|
||||||
@@ -274,6 +277,7 @@ The quick and advanced method support parameters to tailor the behaviour of the
|
|||||||
| Parameter | Description |
|
| Parameter | Description |
|
||||||
| :-------: | ----------- |
|
| :-------: | ----------- |
|
||||||
| -Silent | Suppresses all interactive prompts, so the script will run without requiring any user input. |
|
| -Silent | Suppresses all interactive prompts, so the script will run without requiring any user input. |
|
||||||
|
| -Sysprep | Run the script in Sysprep mode. All changes will be applied to the Windows default user profile and will only affect new user accounts. |
|
||||||
| -RunDefaults | Run the script with the default settings. |
|
| -RunDefaults | Run the script with the default settings. |
|
||||||
| -RemoveApps | Remove the default selection of bloatware apps. |
|
| -RemoveApps | Remove the default selection of bloatware apps. |
|
||||||
| -RemoveAppsCustom | Remove all apps from the 'CustomAppsList' file. IMPORTANT: Run the script with the `-RunAppConfigurator` parameter to create this file first. No apps will be removed if this file does not exist! |
|
| -RemoveAppsCustom | Remove all apps from the 'CustomAppsList' file. IMPORTANT: Run the script with the `-RunAppConfigurator` parameter to create this file first. No apps will be removed if this file does not exist! |
|
||||||
@@ -283,7 +287,8 @@ The quick and advanced method support parameters to tailor the behaviour of the
|
|||||||
| -RemoveDevApps | Remove developer-related apps such as Remote Desktop, DevHome and Power Automate. |
|
| -RemoveDevApps | Remove developer-related apps such as Remote Desktop, DevHome and Power Automate. |
|
||||||
| -RemoveGamingApps | Remove the Xbox App and Xbox Gamebar. |
|
| -RemoveGamingApps | Remove the Xbox App and Xbox Gamebar. |
|
||||||
| -DisableDVR | Disable Xbox game/screen recording feature & stop gaming overlay popups. |
|
| -DisableDVR | Disable Xbox game/screen recording feature & stop gaming overlay popups. |
|
||||||
| -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) |
|
| -ClearStart | Remove all pinned apps from the start menu for the current user (Windows 11 update 22H2 or later only) |
|
||||||
|
| -ClearStartAllUsers | Remove all pinned apps from the start menu for all existing and new users. (Windows 11 update 22H2 or later only) |
|
||||||
| -DisableTelemetry | Disable telemetry, diagnostic data & targeted ads. |
|
| -DisableTelemetry | Disable telemetry, diagnostic data & targeted ads. |
|
||||||
| -DisableBing | Disable & remove bing search, bing AI & cortana in Windows search. |
|
| -DisableBing | Disable & remove bing search, bing AI & cortana in Windows search. |
|
||||||
| -DisableSuggestions | Disable tips, tricks, suggestions and ads in start, settings, notifications and Windows explorer. |
|
| -DisableSuggestions | Disable tips, tricks, suggestions and ads in start, settings, notifications and Windows explorer. |
|
||||||
|
|||||||
Binary file not shown.
@@ -0,0 +1,7 @@
|
|||||||
|
Windows Registry Editor Version 5.00
|
||||||
|
|
||||||
|
[hkey_users\default\Software\Policies\Microsoft\Windows\WindowsAI]
|
||||||
|
"DisableAIDataAnalysis"=dword:00000001
|
||||||
|
|
||||||
|
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsAI]
|
||||||
|
"DisableAIDataAnalysis"=dword:00000001
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,13 @@
|
|||||||
|
Windows Registry Editor Version 5.00
|
||||||
|
|
||||||
|
; Disable Copilot button on taskbar
|
||||||
|
[hkey_users\default\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced]
|
||||||
|
"ShowCopilotButton"=dword:00000000
|
||||||
|
|
||||||
|
; Disable Copilot service for current user
|
||||||
|
[hkey_users\default\Software\Policies\Microsoft\Windows\WindowsCopilot]
|
||||||
|
"TurnOffWindowsCopilot"=dword:00000001
|
||||||
|
|
||||||
|
; Disable Copilot service for all users
|
||||||
|
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsCopilot]
|
||||||
|
"TurnOffWindowsCopilot"=dword:00000001
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
Windows Registry Editor Version 5.00
|
||||||
|
|
||||||
|
[hkey_users\default\System\GameConfigStore]
|
||||||
|
"GameDVR_Enabled"=dword:00000000
|
||||||
|
|
||||||
|
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\GameDVR]
|
||||||
|
"AllowGameDVR"=dword:00000000
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+140
-44
@@ -3,6 +3,7 @@
|
|||||||
[CmdletBinding(SupportsShouldProcess)]
|
[CmdletBinding(SupportsShouldProcess)]
|
||||||
param (
|
param (
|
||||||
[switch]$Silent,
|
[switch]$Silent,
|
||||||
|
[switch]$Sysprep,
|
||||||
[switch]$RunAppConfigurator,
|
[switch]$RunAppConfigurator,
|
||||||
[switch]$RunDefaults, [switch]$RunWin11Defaults,
|
[switch]$RunDefaults, [switch]$RunWin11Defaults,
|
||||||
[switch]$RemoveApps,
|
[switch]$RemoveApps,
|
||||||
@@ -29,6 +30,7 @@ param (
|
|||||||
[switch]$DisableChat,
|
[switch]$DisableChat,
|
||||||
[switch]$HideChat,
|
[switch]$HideChat,
|
||||||
[switch]$ClearStart,
|
[switch]$ClearStart,
|
||||||
|
[switch]$ClearStartAllUsers,
|
||||||
[switch]$RevertContextMenu,
|
[switch]$RevertContextMenu,
|
||||||
[switch]$DisableOnedrive, [switch]$HideOnedrive,
|
[switch]$DisableOnedrive, [switch]$HideOnedrive,
|
||||||
[switch]$Disable3dObjects, [switch]$Hide3dObjects,
|
[switch]$Disable3dObjects, [switch]$Hide3dObjects,
|
||||||
@@ -184,7 +186,7 @@ function ShowAppSelectionForm {
|
|||||||
if ($appString.length -gt 0) {
|
if ($appString.length -gt 0) {
|
||||||
if ($onlyInstalledCheckBox.Checked) {
|
if ($onlyInstalledCheckBox.Checked) {
|
||||||
# onlyInstalledCheckBox is checked, check if app is installed before adding it to selectionBox
|
# onlyInstalledCheckBox is checked, check if app is installed before adding it to selectionBox
|
||||||
if ($listOfApps -like ("*" + $appString + "*")) {
|
if ($listOfApps -like ("*$appString*")) {
|
||||||
$installed = "installed"
|
$installed = "installed"
|
||||||
}
|
}
|
||||||
elseif (($appString -eq "Microsoft.Edge") -and ($listOfApps -like "* XPFFTQ037JWMHS *")) {
|
elseif (($appString -eq "Microsoft.Edge") -and ($listOfApps -like "* XPFFTQ037JWMHS *")) {
|
||||||
@@ -379,7 +381,17 @@ function RegImport {
|
|||||||
)
|
)
|
||||||
|
|
||||||
Write-Output $message
|
Write-Output $message
|
||||||
reg import $path
|
|
||||||
|
|
||||||
|
if (!$global:Params.ContainsKey("Sysprep")) {
|
||||||
|
reg import "$PSScriptRoot\Regfiles\$path"
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
reg load "HKU\Default" "C:\Users\Default\NTUSER.DAT" | Out-Null
|
||||||
|
reg import "$PSScriptRoot\Regfiles\Sysprep\$path"
|
||||||
|
reg unload "HKU\Default" | Out-Null
|
||||||
|
}
|
||||||
|
|
||||||
Write-Output ""
|
Write-Output ""
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -404,7 +416,8 @@ function RestartExplorer {
|
|||||||
# Credit: https://lazyadmin.nl/win-11/customize-windows-11-start-menu-layout/
|
# Credit: https://lazyadmin.nl/win-11/customize-windows-11-start-menu-layout/
|
||||||
function ClearStartMenu {
|
function ClearStartMenu {
|
||||||
param (
|
param (
|
||||||
$message
|
$message,
|
||||||
|
$applyToAllUsers = $True
|
||||||
)
|
)
|
||||||
|
|
||||||
Write-Output $message
|
Write-Output $message
|
||||||
@@ -419,6 +432,8 @@ function ClearStartMenu {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($applyToAllUsers) {
|
||||||
|
# Remove startmenu pinned apps for all users
|
||||||
# Get all user profile folders
|
# Get all user profile folders
|
||||||
$usersStartMenu = get-childitem -path "C:\Users\*\AppData\Local\Packages\Microsoft.Windows.StartMenuExperienceHost_cw5n1h2txyewy\LocalState"
|
$usersStartMenu = get-childitem -path "C:\Users\*\AppData\Local\Packages\Microsoft.Windows.StartMenuExperienceHost_cw5n1h2txyewy\LocalState"
|
||||||
|
|
||||||
@@ -430,13 +445,12 @@ function ClearStartMenu {
|
|||||||
# Check if bin file exists
|
# Check if bin file exists
|
||||||
if (Test-Path $startmenuBinFile) {
|
if (Test-Path $startmenuBinFile) {
|
||||||
# Backup current startmenu file
|
# Backup current startmenu file
|
||||||
Move-Item -Path $startmenuBinFile -Destination $backupBinFile
|
Move-Item -Path $startmenuBinFile -Destination $backupBinFile -Force
|
||||||
|
|
||||||
# Copy template file
|
# Copy template file
|
||||||
Copy-Item -Path $startmenuTemplate -Destination $startmenu -Force
|
Copy-Item -Path $startmenuTemplate -Destination $startmenu -Force
|
||||||
|
|
||||||
$cpyMsg = "Replaced start menu for user " + $startmenu.Fullname.Split("\")[2]
|
Write-Output "Replaced start menu for user $($startmenu.Fullname.Split("\")[2])"
|
||||||
Write-Output $cpyMsg
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
# Bin file doesn't exist, indicating the user is not running the correct version of Windows. Exit function
|
# Bin file doesn't exist, indicating the user is not running the correct version of Windows. Exit function
|
||||||
@@ -462,6 +476,30 @@ function ClearStartMenu {
|
|||||||
Write-Output "Copied start menu template to default user folder"
|
Write-Output "Copied start menu template to default user folder"
|
||||||
Write-Output ""
|
Write-Output ""
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
# Only remove startmenu pinned apps for current logged in user
|
||||||
|
$startmenuBinFile = "C:\Users\$([Environment]::UserName)\AppData\Local\Packages\Microsoft.Windows.StartMenuExperienceHost_cw5n1h2txyewy\LocalState\start2.bin"
|
||||||
|
$backupBinFile = $startmenuBinFile + ".bak"
|
||||||
|
|
||||||
|
# Check if bin file exists
|
||||||
|
if (Test-Path $startmenuBinFile) {
|
||||||
|
# Backup current startmenu file
|
||||||
|
Move-Item -Path $startmenuBinFile -Destination $backupBinFile -Force
|
||||||
|
|
||||||
|
# Copy template file
|
||||||
|
Copy-Item -Path $startmenuTemplate -Destination $startmenuBinFile -Force
|
||||||
|
|
||||||
|
Write-Output "Replaced start menu for user $([Environment]::UserName)"
|
||||||
|
Write-Output ""
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
# Bin file doesn't exist, indicating the user is not running the correct version of Windows. Exit function
|
||||||
|
Write-Host "Error: Unable to clear start menu, start2.bin file could not found for user $([Environment]::UserName)" -ForegroundColor Red
|
||||||
|
Write-Output ""
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
# Add parameter to script and write to file
|
# Add parameter to script and write to file
|
||||||
@@ -487,7 +525,7 @@ function AddParameter {
|
|||||||
$global:FirstSelection = $false
|
$global:FirstSelection = $false
|
||||||
|
|
||||||
# Create entry and add it to the file
|
# Create entry and add it to the file
|
||||||
$entry = $parameterName + "#- " + $message
|
$entry = "$parameterName#- $message"
|
||||||
Add-Content -Path "$PSScriptRoot/SavedSettings" -Value $entry
|
Add-Content -Path "$PSScriptRoot/SavedSettings" -Value $entry
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -497,7 +535,11 @@ function PrintHeader {
|
|||||||
$title
|
$title
|
||||||
)
|
)
|
||||||
|
|
||||||
$fullTitle = " Win11Debloat Script - " + $title
|
$fullTitle = " Win11Debloat Script - $title"
|
||||||
|
|
||||||
|
if($global:Params.ContainsKey("Sysprep")) {
|
||||||
|
$fullTitle = "$fullTitle (Sysprep mode)"
|
||||||
|
}
|
||||||
|
|
||||||
Clear-Host
|
Clear-Host
|
||||||
Write-Output "-------------------------------------------------------------------------------------------"
|
Write-Output "-------------------------------------------------------------------------------------------"
|
||||||
@@ -530,6 +572,15 @@ function AwaitKeyToExit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
##################################################################################################################
|
||||||
|
# #
|
||||||
|
# SCRIPT START #
|
||||||
|
# #
|
||||||
|
##################################################################################################################
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Check if winget is installed & if it is, check if the version is at least v1.4
|
# Check if winget is installed & if it is, check if the version is at least v1.4
|
||||||
if ((Get-AppxPackage -Name "*Microsoft.DesktopAppInstaller*") -and ((winget -v) -replace 'v','' -gt 1.4)) {
|
if ((Get-AppxPackage -Name "*Microsoft.DesktopAppInstaller*") -and ((winget -v) -replace 'v','' -gt 1.4)) {
|
||||||
$global:wingetInstalled = $true
|
$global:wingetInstalled = $true
|
||||||
@@ -546,12 +597,15 @@ else {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Get current Windows build version to compare against features
|
||||||
|
$WinVersion = Get-ItemPropertyValue 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion' CurrentBuild
|
||||||
|
|
||||||
# Hide progress bars for app removal, as they block Win11Debloat's output
|
# Hide progress bars for app removal, as they block Win11Debloat's output
|
||||||
$ProgressPreference = 'SilentlyContinue'
|
$ProgressPreference = 'SilentlyContinue'
|
||||||
|
|
||||||
$global:Params = $PSBoundParameters
|
$global:Params = $PSBoundParameters
|
||||||
$global:FirstSelection = $true
|
$global:FirstSelection = $true
|
||||||
$SPParams = 'WhatIf', 'Confirm', 'Verbose', 'Silent'
|
$SPParams = 'WhatIf', 'Confirm', 'Verbose', 'Silent', 'Sysprep'
|
||||||
$SPParamCount = 0
|
$SPParamCount = 0
|
||||||
|
|
||||||
# Count how many SPParams exist within Params
|
# Count how many SPParams exist within Params
|
||||||
@@ -562,6 +616,21 @@ foreach ($Param in $SPParams) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($global:Params.ContainsKey("Sysprep")) {
|
||||||
|
# Exit script if default user directory or NTUSER.DAT file cannot be found
|
||||||
|
if (-not (Test-Path "C:\Users\Default\NTUSER.DAT")) {
|
||||||
|
Write-Host "Error: Unable to start Win11Debloat in Sysprep mode, cannot find default user folder at 'C:\Users\Default\'" -ForegroundColor Red
|
||||||
|
AwaitKeyToExit
|
||||||
|
Exit
|
||||||
|
}
|
||||||
|
# Exit script if run in Sysprep mode on Windows 10
|
||||||
|
if ($WinVersion -lt 22000) {
|
||||||
|
Write-Host "Error: Win11Debloat Sysprep mode is not supported on Windows 10" -ForegroundColor Red
|
||||||
|
AwaitKeyToExit
|
||||||
|
Exit
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
# Remove SavedSettings file if it exists and is empty
|
# Remove SavedSettings file if it exists and is empty
|
||||||
if ((Test-Path "$PSScriptRoot/SavedSettings") -and ([String]::IsNullOrWhiteSpace((Get-content "$PSScriptRoot/SavedSettings")))) {
|
if ((Test-Path "$PSScriptRoot/SavedSettings") -and ([String]::IsNullOrWhiteSpace((Get-content "$PSScriptRoot/SavedSettings")))) {
|
||||||
Remove-Item -Path "$PSScriptRoot/SavedSettings" -recurse
|
Remove-Item -Path "$PSScriptRoot/SavedSettings" -recurse
|
||||||
@@ -583,7 +652,6 @@ if ($RunAppConfigurator) {
|
|||||||
|
|
||||||
AwaitKeyToExit
|
AwaitKeyToExit
|
||||||
|
|
||||||
# Exit script
|
|
||||||
Exit
|
Exit
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -677,27 +745,27 @@ if ((-not $global:Params.Count) -or $RunDefaults -or $RunWin11Defaults -or ($SPP
|
|||||||
Write-Host " (1) Only remove the default selection of bloatware apps from 'Appslist.txt'" -ForegroundColor Yellow
|
Write-Host " (1) Only remove the default selection of bloatware apps from 'Appslist.txt'" -ForegroundColor Yellow
|
||||||
Write-Host " (2) Remove default selection of bloatware apps, aswell as mail & calendar apps, developer apps and gaming apps" -ForegroundColor Yellow
|
Write-Host " (2) Remove default selection of bloatware apps, aswell as mail & calendar apps, developer apps and gaming apps" -ForegroundColor Yellow
|
||||||
Write-Host " (3) Select which apps to remove and which to keep" -ForegroundColor Yellow
|
Write-Host " (3) Select which apps to remove and which to keep" -ForegroundColor Yellow
|
||||||
$RemoveCommAppInput = Read-Host "Remove any pre-installed apps? (n/1/2/3)"
|
$RemoveAppsInput = Read-Host "Remove any pre-installed apps? (n/1/2/3)"
|
||||||
|
|
||||||
# Show app selection form if user entered option 3
|
# Show app selection form if user entered option 3
|
||||||
if ($RemoveCommAppInput -eq '3') {
|
if ($RemoveAppsInput -eq '3') {
|
||||||
$result = ShowAppSelectionForm
|
$result = ShowAppSelectionForm
|
||||||
|
|
||||||
if ($result -ne [System.Windows.Forms.DialogResult]::OK) {
|
if ($result -ne [System.Windows.Forms.DialogResult]::OK) {
|
||||||
# User cancelled or closed app selection, show error and change RemoveCommAppInput so the menu will be shown again
|
# User cancelled or closed app selection, show error and change RemoveAppsInput so the menu will be shown again
|
||||||
Write-Output ""
|
Write-Output ""
|
||||||
Write-Host "Cancelled application selection, please try again" -ForegroundColor Red
|
Write-Host "Cancelled application selection, please try again" -ForegroundColor Red
|
||||||
|
|
||||||
$RemoveCommAppInput = 'c'
|
$RemoveAppsInput = 'c'
|
||||||
}
|
}
|
||||||
|
|
||||||
Write-Output ""
|
Write-Output ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
while ($RemoveCommAppInput -ne 'n' -and $RemoveCommAppInput -ne '0' -and $RemoveCommAppInput -ne '1' -and $RemoveCommAppInput -ne '2' -and $RemoveCommAppInput -ne '3')
|
while ($RemoveAppsInput -ne 'n' -and $RemoveAppsInput -ne '0' -and $RemoveAppsInput -ne '1' -and $RemoveAppsInput -ne '2' -and $RemoveAppsInput -ne '3')
|
||||||
|
|
||||||
# Select correct option based on user input
|
# Select correct option based on user input
|
||||||
switch ($RemoveCommAppInput) {
|
switch ($RemoveAppsInput) {
|
||||||
'1' {
|
'1' {
|
||||||
AddParameter 'RemoveApps' 'Remove default selection of bloatware apps'
|
AddParameter 'RemoveApps' 'Remove default selection of bloatware apps'
|
||||||
}
|
}
|
||||||
@@ -726,8 +794,31 @@ if ((-not $global:Params.Count) -or $RunDefaults -or $RunWin11Defaults -or ($SPP
|
|||||||
if ($WinVersion -ge 22621){
|
if ($WinVersion -ge 22621){
|
||||||
Write-Output ""
|
Write-Output ""
|
||||||
|
|
||||||
if ($( Read-Host -Prompt "Remove all pinned apps from the start menu? This applies to all existing and new users and can't be reverted (y/n)" ) -eq 'y') {
|
if ($global:Params.ContainsKey("Sysprep")) {
|
||||||
AddParameter 'ClearStart' 'Remove all pinned apps from the start menu for new and existing users'
|
if ($( Read-Host -Prompt "Remove all pinned apps from the start menu for all existing and new users? (y/n)" ) -eq 'y') {
|
||||||
|
AddParameter 'ClearStartAllUsers' 'Remove all pinned apps from the start menu for existing and new users'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Do {
|
||||||
|
Write-Host "Options:" -ForegroundColor Yellow
|
||||||
|
Write-Host " (n) Don't remove any pinned apps from the start menu" -ForegroundColor Yellow
|
||||||
|
Write-Host " (1) Remove all pinned apps from the start menu for this user only ($([Environment]::UserName))" -ForegroundColor Yellow
|
||||||
|
Write-Host " (2) Remove all pinned apps from the start menu for all existing and new users" -ForegroundColor Yellow
|
||||||
|
$ClearStartInput = Read-Host "Remove all pinned apps from the start menu? This cannot be reverted (n/1/2)"
|
||||||
|
Write-Output ""
|
||||||
|
}
|
||||||
|
while ($ClearStartInput -ne 'n' -and $ClearStartInput -ne '0' -and $ClearStartInput -ne '1' -and $ClearStartInput -ne '2')
|
||||||
|
|
||||||
|
# Select correct option based on user input
|
||||||
|
switch ($ClearStartInput) {
|
||||||
|
'1' {
|
||||||
|
AddParameter 'ClearStart' "Remove all pinned apps from the start menu for this user only"
|
||||||
|
}
|
||||||
|
'2' {
|
||||||
|
AddParameter 'ClearStartAllUsers' "Remove all pinned apps from the start menu for all existing and new users"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1080,19 +1171,23 @@ else {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
'DisableDVR' {
|
'DisableDVR' {
|
||||||
RegImport "> Disabling Xbox game/screen recording..." $PSScriptRoot\Regfiles\Disable_DVR.reg
|
RegImport "> Disabling Xbox game/screen recording..." "Disable_DVR.reg"
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
'ClearStart' {
|
'ClearStart' {
|
||||||
ClearStartMenu "> Removing all pinned apps from the start menu..."
|
ClearStartMenu "> Removing all pinned apps from the start menu..." $False
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
'ClearStartAllUsers' {
|
||||||
|
ClearStartMenu "> Removing all pinned apps from the start menu for all users..."
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
'DisableTelemetry' {
|
'DisableTelemetry' {
|
||||||
RegImport "> Disabling telemetry, diagnostic data, app-launch tracking and targeted ads..." $PSScriptRoot\Regfiles\Disable_Telemetry.reg
|
RegImport "> Disabling telemetry, diagnostic data, app-launch tracking and targeted ads..." "Disable_Telemetry.reg"
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
{$_ -in "DisableBingSearches", "DisableBing"} {
|
{$_ -in "DisableBingSearches", "DisableBing"} {
|
||||||
RegImport "> Disabling bing search, bing AI & cortana in Windows search..." $PSScriptRoot\Regfiles\Disable_Bing_Cortana_In_Search.reg
|
RegImport "> Disabling bing search, bing AI & cortana in Windows search..." "Disable_Bing_Cortana_In_Search.reg"
|
||||||
|
|
||||||
# Also remove the app package for bing search
|
# Also remove the app package for bing search
|
||||||
$appsList = 'Microsoft.BingSearch'
|
$appsList = 'Microsoft.BingSearch'
|
||||||
@@ -1103,91 +1198,92 @@ else {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
{$_ -in "DisableLockscrTips", "DisableLockscreenTips"} {
|
{$_ -in "DisableLockscrTips", "DisableLockscreenTips"} {
|
||||||
RegImport "> Disabling tips & tricks on the lockscreen..." $PSScriptRoot\Regfiles\Disable_Lockscreen_Tips.reg
|
RegImport "> Disabling tips & tricks on the lockscreen..." "Disable_Lockscreen_Tips.reg"
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
{$_ -in "DisableSuggestions", "DisableWindowsSuggestions"} {
|
{$_ -in "DisableSuggestions", "DisableWindowsSuggestions"} {
|
||||||
RegImport "> Disabling tips, tricks, suggestions and ads across Windows..." $PSScriptRoot\Regfiles\Disable_Windows_Suggestions.reg
|
RegImport "> Disabling tips, tricks, suggestions and ads across Windows..." "Disable_Windows_Suggestions.reg"
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
'RevertContextMenu' {
|
'RevertContextMenu' {
|
||||||
RegImport "> Restoring the old Windows 10 style context menu..." $PSScriptRoot\Regfiles\Disable_Show_More_Options_Context_Menu.reg
|
RegImport "> Restoring the old Windows 10 style context menu..." "Disable_Show_More_Options_Context_Menu.reg"
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
'TaskbarAlignLeft' {
|
'TaskbarAlignLeft' {
|
||||||
RegImport "> Aligning taskbar buttons to the left..." $PSScriptRoot\Regfiles\Align_Taskbar_Left.reg
|
RegImport "> Aligning taskbar buttons to the left..." "Align_Taskbar_Left.reg"
|
||||||
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
'HideSearchTb' {
|
'HideSearchTb' {
|
||||||
RegImport "> Hiding the search icon from the taskbar..." $PSScriptRoot\Regfiles\Hide_Search_Taskbar.reg
|
RegImport "> Hiding the search icon from the taskbar..." "Hide_Search_Taskbar.reg"
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
'ShowSearchIconTb' {
|
'ShowSearchIconTb' {
|
||||||
RegImport "> Changing taskbar search to icon only..." $PSScriptRoot\Regfiles\Show_Search_Icon.reg
|
RegImport "> Changing taskbar search to icon only..." "Show_Search_Icon.reg"
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
'ShowSearchLabelTb' {
|
'ShowSearchLabelTb' {
|
||||||
RegImport "> Changing taskbar search to icon with label..." $PSScriptRoot\Regfiles\Show_Search_Icon_And_Label.reg
|
RegImport "> Changing taskbar search to icon with label..." "Show_Search_Icon_And_Label.reg"
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
'ShowSearchBoxTb' {
|
'ShowSearchBoxTb' {
|
||||||
RegImport "> Changing taskbar search to search box..." $PSScriptRoot\Regfiles\Show_Search_Box.reg
|
RegImport "> Changing taskbar search to search box..." "Show_Search_Box.reg"
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
'HideTaskview' {
|
'HideTaskview' {
|
||||||
RegImport "> Hiding the taskview button from the taskbar..." $PSScriptRoot\Regfiles\Hide_Taskview_Taskbar.reg
|
RegImport "> Hiding the taskview button from the taskbar..." "Hide_Taskview_Taskbar.reg"
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
'DisableCopilot' {
|
'DisableCopilot' {
|
||||||
RegImport "> Disabling Windows copilot..." $PSScriptRoot\Regfiles\Disable_Copilot.reg
|
RegImport "> Disabling Windows copilot..." "Disable_Copilot.reg"
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
'DisableRecall' {
|
'DisableRecall' {
|
||||||
RegImport "> Disabling Windows Recall snapshots..." $PSScriptRoot\Regfiles\Disable_AI_Recall.reg
|
RegImport "> Disabling Windows Recall snapshots..." "Disable_AI_Recall.reg"
|
||||||
continue
|
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..." "Disable_Widgets_Taskbar.reg"
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
{$_ -in "HideChat", "DisableChat"} {
|
{$_ -in "HideChat", "DisableChat"} {
|
||||||
RegImport "> Hiding the chat icon from the taskbar..." $PSScriptRoot\Regfiles\Disable_Chat_Taskbar.reg
|
RegImport "> Hiding the chat icon from the taskbar..." "Disable_Chat_Taskbar.reg"
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
'ShowHiddenFolders' {
|
'ShowHiddenFolders' {
|
||||||
RegImport "> Unhiding hidden files, folders and drives..." $PSScriptRoot\Regfiles\Show_Hidden_Folders.reg
|
RegImport "> Unhiding hidden files, folders and drives..." "Show_Hidden_Folders.reg"
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
'ShowKnownFileExt' {
|
'ShowKnownFileExt' {
|
||||||
RegImport "> Enabling file extensions for known file types..." $PSScriptRoot\Regfiles\Show_Extensions_For_Known_File_Types.reg
|
RegImport "> Enabling file extensions for known file types..." "Show_Extensions_For_Known_File_Types.reg"
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
'HideDupliDrive' {
|
'HideDupliDrive' {
|
||||||
RegImport "> Hiding duplicate removable drive entries from the Windows explorer navigation pane..." $PSScriptRoot\Regfiles\Hide_duplicate_removable_drives_from_navigation_pane_of_File_Explorer.reg
|
RegImport "> Hiding duplicate removable drive entries from the Windows explorer navigation pane..." "Hide_duplicate_removable_drives_from_navigation_pane_of_File_Explorer.reg"
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
{$_ -in "HideOnedrive", "DisableOnedrive"} {
|
{$_ -in "HideOnedrive", "DisableOnedrive"} {
|
||||||
RegImport "> Hiding the onedrive folder from the Windows explorer navigation pane..." $PSScriptRoot\Regfiles\Hide_Onedrive_Folder.reg
|
RegImport "> Hiding the onedrive folder from the Windows explorer navigation pane..." "Hide_Onedrive_Folder.reg"
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
{$_ -in "Hide3dObjects", "Disable3dObjects"} {
|
{$_ -in "Hide3dObjects", "Disable3dObjects"} {
|
||||||
RegImport "> Hiding the 3D objects folder from the Windows explorer navigation pane..." $PSScriptRoot\Regfiles\Hide_3D_Objects_Folder.reg
|
RegImport "> Hiding the 3D objects folder from the Windows explorer navigation pane..." "Hide_3D_Objects_Folder.reg"
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
{$_ -in "HideMusic", "DisableMusic"} {
|
{$_ -in "HideMusic", "DisableMusic"} {
|
||||||
RegImport "> Hiding the music folder from the Windows explorer navigation pane..." $PSScriptRoot\Regfiles\Hide_Music_folder.reg
|
RegImport "> Hiding the music folder from the Windows explorer navigation pane..." "Hide_Music_folder.reg"
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
{$_ -in "HideIncludeInLibrary", "DisableIncludeInLibrary"} {
|
{$_ -in "HideIncludeInLibrary", "DisableIncludeInLibrary"} {
|
||||||
RegImport "> Hiding 'Include in library' in the context menu..." $PSScriptRoot\Regfiles\Disable_Include_in_library_from_context_menu.reg
|
RegImport "> Hiding 'Include in library' in the context menu..." "Disable_Include_in_library_from_context_menu.reg"
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
{$_ -in "HideGiveAccessTo", "DisableGiveAccessTo"} {
|
{$_ -in "HideGiveAccessTo", "DisableGiveAccessTo"} {
|
||||||
RegImport "> Hiding 'Give access to' in the context menu..." $PSScriptRoot\Regfiles\Disable_Give_access_to_context_menu.reg
|
RegImport "> Hiding 'Give access to' in the context menu..." "Disable_Give_access_to_context_menu.reg"
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
{$_ -in "HideShare", "DisableShare"} {
|
{$_ -in "HideShare", "DisableShare"} {
|
||||||
RegImport "> Hiding 'Share' in the context menu..." $PSScriptRoot\Regfiles\Disable_Share_from_context_menu.reg
|
RegImport "> Hiding 'Share' in the context menu..." "Disable_Share_from_context_menu.reg"
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user