mirror of
https://github.com/Raphire/Win11Debloat.git
synced 2025-11-17 02:56:17 +00:00
Win11Debloat will now remember your last used custom settings
Refactoring & Linting Removed 'GamingAppsList.txt'
This commit is contained in:
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
LastSettings
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
# The apps below this line will only be uninstalled if selected in custom mode or when launching
|
|
||||||
# the script with the '-RemoveGamingApps' parameter. If you wish to KEEP any of the apps below
|
|
||||||
# simply add a # character in front of the specific app in the list below.
|
|
||||||
#
|
|
||||||
*Microsoft.GamingApp* # Modern Xbox Gaming App, required for installing some PC games
|
|
||||||
*Microsoft.XboxGameOverlay* # Game overlay, required/useful for some games
|
|
||||||
*Microsoft.XboxGamingOverlay* # Game overlay, required/useful for some games
|
|
||||||
@@ -1,9 +1,5 @@
|
|||||||
-------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------
|
||||||
Win11Debloat - Setup
|
Win11Debloat - Setup
|
||||||
-------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------
|
||||||
(1) Run Win11Debloat with the default settings
|
(1) Default mode: Run the script with the default settings
|
||||||
(2) Custom mode: Manually select what changes you want Win11Debloat to make
|
(2) Custom mode: Manually select what changes you want Win11Debloat to make
|
||||||
|
|
||||||
(0) Show information about the script
|
|
||||||
|
|
||||||
|
|
||||||
20
README.md
20
README.md
@@ -10,7 +10,8 @@ You can pick and choose exactly which modifications you want the script to make,
|
|||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
### The Default Settings Will:
|
### Default Settings
|
||||||
|
|
||||||
- Remove all bloatware apps from [this list](#apps-that-are-removed).
|
- Remove all bloatware apps from [this list](#apps-that-are-removed).
|
||||||
- Disable telemetry, diagnostic data, app-launch tracking & targeted ads.
|
- Disable telemetry, diagnostic data, app-launch tracking & targeted ads.
|
||||||
- Disable bing search & cortana in windows search.
|
- Disable bing search & cortana in windows search.
|
||||||
@@ -21,7 +22,8 @@ You can pick and choose exactly which modifications you want the script to make,
|
|||||||
- Hide the Chat (meet now) icon from the taskbar.
|
- Hide the Chat (meet now) icon from the taskbar.
|
||||||
- Hide the 3D objects folder under 'This pc' in windows explorer. (Windows 10 only)
|
- Hide the 3D objects folder under 'This pc' in windows explorer. (Windows 10 only)
|
||||||
|
|
||||||
### Alternatively Custom Mode Will Allow You To:
|
### All Features
|
||||||
|
|
||||||
- Remove all bloatware apps from [this list](#apps-that-are-removed) and optionally also remove communication and gaming-related apps.
|
- Remove all bloatware apps from [this list](#apps-that-are-removed) and optionally also remove communication and gaming-related apps.
|
||||||
- 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. NOTE: This applies to 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.
|
||||||
@@ -43,9 +45,10 @@ You can pick and choose exactly which modifications you want the script to make,
|
|||||||
<br/>
|
<br/>
|
||||||
|
|
||||||
> [!TIP]
|
> [!TIP]
|
||||||
> You can change what apps are and aren't removed by editing the ['Appslist.txt'](https://github.com/Raphire/Win11Debloat/blob/master/Appslist.txt) and ['GamingAppslist.txt'](https://github.com/Raphire/Win11Debloat/blob/master/GamingAppslist.txt) files.
|
> You can change what apps are and aren't removed by editing the ['Appslist.txt'](https://github.com/Raphire/Win11Debloat/blob/master/Appslist.txt) files.
|
||||||
|
|
||||||
### Apps that ARE removed
|
### Apps that ARE removed
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary>Click to expand</summary>
|
<summary>Click to expand</summary>
|
||||||
<blockquote>
|
<blockquote>
|
||||||
@@ -142,6 +145,7 @@ You can pick and choose exactly which modifications you want the script to make,
|
|||||||
</details>
|
</details>
|
||||||
|
|
||||||
### Apps that are NOT removed
|
### Apps that are NOT removed
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary>Click to expand</summary>
|
<summary>Click to expand</summary>
|
||||||
<blockquote>
|
<blockquote>
|
||||||
@@ -181,7 +185,7 @@ You can pick and choose exactly which modifications you want the script to make,
|
|||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
> [!Warning]
|
> [!Warning]
|
||||||
> Great care went into making sure this script does not break any OS functionality, but use this script at your own risk!
|
> Great care went into making sure this script does not break any OS functionality, but use at your own risk!
|
||||||
|
|
||||||
### Easy method
|
### Easy method
|
||||||
|
|
||||||
@@ -190,7 +194,7 @@ You can pick and choose exactly which modifications you want the script to make,
|
|||||||
3. Double click the 'Run.bat' file to start the script. Note: If the console window immediately closes and nothing happens, try the advanced method below.
|
3. Double click the 'Run.bat' file to start the script. Note: If the console window immediately closes and nothing happens, try the advanced method below.
|
||||||
4. Accept the windows UAC prompt to run the script as administrator, this is required for the script to function.
|
4. Accept the windows UAC prompt to run the script as administrator, this is required for the script to function.
|
||||||
5. A new powershell window will now open, showing the Win11Debloat menu. Select either the default or custom setup to continue.
|
5. A new powershell window will now open, showing the Win11Debloat menu. Select either the default or custom setup to continue.
|
||||||
6. Carefully read through and follow the on-screen instructions.
|
6. Carefully read through and follow the on-screen instructions.
|
||||||
|
|
||||||
After making the selected changes the Win11Debloat script will restart the Windows Explorer process to properly apply them. If Windows Explorer does not recover after running the script and your desktop stays black, don't worry. Just press Ctrl + Alt + Del to restart your PC.
|
After making the selected changes the Win11Debloat script will restart the Windows Explorer process to properly apply them. If Windows Explorer does not recover after running the script and your desktop stays black, don't worry. Just press Ctrl + Alt + Del to restart your PC.
|
||||||
|
|
||||||
@@ -230,7 +234,7 @@ To run the script without any user input, simply add parameters at the end, exam
|
|||||||
| -ShowSearchLabelTb | Show search icon with label on the taskbar. (Windows 11 only) |
|
| -ShowSearchLabelTb | Show search icon with label on the taskbar. (Windows 11 only) |
|
||||||
| -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) |
|
||||||
| -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) |
|
||||||
@@ -239,7 +243,3 @@ To run the script without any user input, simply add parameters at the end, exam
|
|||||||
| -HideIncludeInLibrary | Hide the 'Include in library' option in the context menu. (Windows 10 only) |
|
| -HideIncludeInLibrary | Hide the 'Include in library' option in the context menu. (Windows 10 only) |
|
||||||
| -HideGiveAccessTo | Hide the 'Give access to' option in the context menu. (Windows 10 only) |
|
| -HideGiveAccessTo | Hide the 'Give access to' option in the context menu. (Windows 10 only) |
|
||||||
| -HideShare | Hide the 'Share' option in the context menu. (Windows 10 only) |
|
| -HideShare | Hide the 'Share' option in the context menu. (Windows 10 only) |
|
||||||
|
|
||||||
## Reverting Changes
|
|
||||||
|
|
||||||
All changes made by Win11Debloat can be reverted using the registry files in the 'Regfiles' folder and all apps can be reinstalled from the Microsoft Store.
|
|
||||||
|
|||||||
251
Win11Debloat.ps1
251
Win11Debloat.ps1
@@ -110,11 +110,11 @@ function RemoveSpecificApps {
|
|||||||
function RegImport {
|
function RegImport {
|
||||||
param
|
param
|
||||||
(
|
(
|
||||||
$Message,
|
$message,
|
||||||
$Path
|
$path
|
||||||
)
|
)
|
||||||
|
|
||||||
Write-Output $Message
|
Write-Output $message
|
||||||
reg import $path
|
reg import $path
|
||||||
Write-Output ""
|
Write-Output ""
|
||||||
}
|
}
|
||||||
@@ -181,18 +181,80 @@ function ClearStartMenu {
|
|||||||
# Copy template to default profile
|
# Copy template to default profile
|
||||||
Copy-Item -Path $startmenuTemplate -Destination $defaultProfile -Force
|
Copy-Item -Path $startmenuTemplate -Destination $defaultProfile -Force
|
||||||
Write-Output "Copied start menu template to default user folder"
|
Write-Output "Copied start menu template to default user folder"
|
||||||
|
Write-Output ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Add parameter to script and write to file
|
||||||
|
function AddParameter {
|
||||||
|
param(
|
||||||
|
$parameterName,
|
||||||
|
$message
|
||||||
|
)
|
||||||
|
|
||||||
|
# Add key if it doesn't already exist
|
||||||
|
if(-not $global:PSBoundParameters.ContainsKey($parameterName)){
|
||||||
|
$global:PSBoundParameters.Add($parameterName, $true)
|
||||||
|
}
|
||||||
|
|
||||||
|
# Create or clear file that stores last used settings
|
||||||
|
if (!(Test-Path "$PSScriptRoot/LastSettings")) {
|
||||||
|
$null = New-Item "$PSScriptRoot/LastSettings"
|
||||||
|
}
|
||||||
|
elseif ($global:FirstSelection) {
|
||||||
|
$global:FirstSelection = $false
|
||||||
|
$null = Clear-Content "$PSScriptRoot/LastSettings"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Create entry and add it to the file
|
||||||
|
$entry = $parameterName + "#- " + $message
|
||||||
|
Add-Content -Path "$PSScriptRoot/LastSettings" -Value $entry
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function PrintHeader {
|
||||||
|
param(
|
||||||
|
$title
|
||||||
|
)
|
||||||
|
|
||||||
|
$fullTitle = " Win11Debloat Script - " + $title
|
||||||
|
|
||||||
|
Clear-Host
|
||||||
|
Write-Output "-------------------------------------------------------------------------------------------"
|
||||||
|
Write-Output $fullTitle
|
||||||
|
Write-Output "-------------------------------------------------------------------------------------------"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function PrintFromFile {
|
||||||
|
param(
|
||||||
|
$path
|
||||||
|
)
|
||||||
|
|
||||||
|
Clear-Host
|
||||||
|
|
||||||
|
# Get & print script menu from file
|
||||||
|
Foreach ($line in (Get-Content -Path $path )) {
|
||||||
|
Write-Output $line
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$FirstSelection = $true
|
||||||
$SPParams = 'WhatIf', 'Confirm', 'Verbose', 'Silent'
|
$SPParams = 'WhatIf', 'Confirm', 'Verbose', 'Silent'
|
||||||
$SPParamCount = 0
|
$SPParamCount = 0
|
||||||
|
|
||||||
foreach ($param in $SPParams) {
|
foreach ($Param in $SPParams) {
|
||||||
if ($PSBoundParameters.ContainsKey($param)) {
|
if ($PSBoundParameters.ContainsKey($Param)) {
|
||||||
$SPParamCount++
|
$SPParamCount++
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Remove LastSetting file if it's empty
|
||||||
|
if ((Test-Path "$PSScriptRoot/LastSettings") -and ([String]::IsNullOrWhiteSpace((Get-content "$PSScriptRoot/LastSettings")))) {
|
||||||
|
Remove-Item -Path "$PSScriptRoot/LastSettings" -recurse
|
||||||
|
}
|
||||||
|
|
||||||
# Change script execution based on provided parameters or user input
|
# Change script execution based on provided parameters or user input
|
||||||
if ((-not $PSBoundParameters.Count) -or $RunDefaults -or $RunWin11Defaults -or ($SPParamCount -eq $PSBoundParameters.Count)) {
|
if ((-not $PSBoundParameters.Count) -or $RunDefaults -or $RunWin11Defaults -or ($SPParamCount -eq $PSBoundParameters.Count)) {
|
||||||
if ($RunDefaults -or $RunWin11Defaults) {
|
if ($RunDefaults -or $RunWin11Defaults) {
|
||||||
@@ -201,54 +263,81 @@ if ((-not $PSBoundParameters.Count) -or $RunDefaults -or $RunWin11Defaults -or (
|
|||||||
else {
|
else {
|
||||||
# Show menu and wait for user input, loops until valid input is provided
|
# Show menu and wait for user input, loops until valid input is provided
|
||||||
Do {
|
Do {
|
||||||
Clear-Host
|
$ModeSelectionMessage = "Please select an option (1/2/0)"
|
||||||
|
|
||||||
# Get & print script menu from file
|
# Get & print script menu from file
|
||||||
Foreach ($line in (Get-Content -Path "$PSScriptRoot/Menus/Menu.txt" )) {
|
PrintFromFile "$PSScriptRoot/Menus/Menu"
|
||||||
Write-Output $line
|
|
||||||
|
# Only show this option if LastSettings file exists
|
||||||
|
if (Test-Path "$PSScriptRoot/LastSettings") {
|
||||||
|
Write-Output "(3) New: Run the script with the settings from last time"
|
||||||
|
$ModeSelectionMessage = "Please select an option (1/2/3/0)"
|
||||||
}
|
}
|
||||||
|
|
||||||
$Mode = Read-Host "Please select an option (1/2/0)"
|
Write-Output ""
|
||||||
|
Write-Output "(0) Show information about the script"
|
||||||
|
Write-Output ""
|
||||||
|
Write-Output ""
|
||||||
|
|
||||||
|
$Mode = Read-Host $ModeSelectionMessage
|
||||||
|
|
||||||
# Show information based on user input, Suppress user prompt if Silent parameter was passed
|
# Show information based on user input, Suppress user prompt if Silent parameter was passed
|
||||||
if ($Mode -eq '0') {
|
if ($Mode -eq '0') {
|
||||||
Clear-Host
|
|
||||||
|
|
||||||
# Get & print script information from file
|
# Get & print script information from file
|
||||||
Foreach ($line in (Get-Content -Path "$PSScriptRoot/Menus/Info.txt" )) {
|
PrintFromFile "$PSScriptRoot/Menus/Info"
|
||||||
Write-Output $line
|
|
||||||
}
|
|
||||||
|
|
||||||
Write-Output "Press any key to go back..."
|
Write-Output "Press any key to go back..."
|
||||||
$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
|
$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
|
||||||
}
|
}
|
||||||
elseif (-not $Silent -and ($Mode -eq '1')) {
|
elseif (-not $Silent -and ($Mode -eq '1')) {
|
||||||
Clear-Host
|
|
||||||
|
|
||||||
# Get & print default settings info from file
|
# Get & print default settings info from file
|
||||||
Foreach ($line in (Get-Content -Path "$PSScriptRoot/Menus/DefaultSettings.txt" )) {
|
PrintFromFile "$PSScriptRoot/Menus/DefaultSettings"
|
||||||
Write-Output $line
|
|
||||||
}
|
|
||||||
|
|
||||||
Write-Output "Press any key to start..."
|
Write-Output "Press any key to start..."
|
||||||
$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
|
$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
|
||||||
}
|
}
|
||||||
|
elseif (($Mode -eq '3')) {
|
||||||
|
if (Test-Path "$PSScriptRoot/LastSettings") {
|
||||||
|
if(-not $Silent) {
|
||||||
|
PrintHeader 'Setup'
|
||||||
|
Write-Output "Win11Debloat will make the following changes:"
|
||||||
|
|
||||||
|
# Get & print default settings info from file
|
||||||
|
Foreach ($Line in (Get-Content -Path "$PSScriptRoot/LastSettings" )) {
|
||||||
|
# Remove any spaces before and after the Appname
|
||||||
|
$Line = $Line.Trim()
|
||||||
|
|
||||||
|
# Check if line has # char, show description, add parameter
|
||||||
|
if (-not ($Line.IndexOf('#') -eq -1)) {
|
||||||
|
Write-Output $Line.Substring(($Line.IndexOf('#') + 1), ($Line.Length - $Line.IndexOf('#') - 1))
|
||||||
|
$Line = $Line.Substring(0, $Line.IndexOf('#'))
|
||||||
|
|
||||||
|
$PSBoundParameters.Add($Line, $true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Write-Output ""
|
||||||
|
Write-Output "Press any key to start..."
|
||||||
|
$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$Mode = $null;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
while ($Mode -ne '1' -and $Mode -ne '2')
|
while ($Mode -ne '1' -and $Mode -ne '2' -and $Mode -ne '3')
|
||||||
}
|
}
|
||||||
|
|
||||||
# Add execution parameters based on the mode
|
# Add execution parameters based on the mode
|
||||||
switch ($Mode) {
|
switch ($Mode) {
|
||||||
# Default mode, no user input required, all (relevant) options are added
|
# Default mode, no user input required, all (relevant) options are added
|
||||||
'1' {
|
'1' {
|
||||||
Clear-Host
|
$DefaultParameterNames = 'RemoveApps','DisableTelemetry','DisableBing','DisableLockscreenTips','DisableSuggestions','ShowKnownFileExt','DisableWidgets','HideChat','DisableCopilot'
|
||||||
Write-Output "-------------------------------------------------------------------------------------------"
|
|
||||||
Write-Output " Win11Debloat Script - Default Configuration"
|
PrintHeader 'Default Configuration'
|
||||||
Write-Output "-------------------------------------------------------------------------------------------"
|
|
||||||
|
|
||||||
# Add default parameters if they don't already exist
|
# Add default parameters if they don't already exist
|
||||||
$DefaultParameterNames = 'RemoveApps','DisableTelemetry','DisableBing','DisableLockscreenTips','DisableSuggestions','ShowKnownFileExt','DisableWidgets','HideChat','DisableCopilot'
|
|
||||||
|
|
||||||
foreach ($ParameterName in $DefaultParameterNames) {
|
foreach ($ParameterName in $DefaultParameterNames) {
|
||||||
if(-not $PSBoundParameters.ContainsKey($ParameterName)){
|
if(-not $PSBoundParameters.ContainsKey($ParameterName)){
|
||||||
$PSBoundParameters.Add($ParameterName, $true)
|
$PSBoundParameters.Add($ParameterName, $true)
|
||||||
@@ -263,16 +352,13 @@ if ((-not $PSBoundParameters.Count) -or $RunDefaults -or $RunWin11Defaults -or (
|
|||||||
|
|
||||||
# Custom mode, add options based on user input
|
# Custom mode, add options based on user input
|
||||||
'2' {
|
'2' {
|
||||||
# Get current windows version to compare against features
|
# Get current Windows build version to compare against features
|
||||||
$winversion = Get-ItemPropertyValue 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion' CurrentBuild
|
$WinVersion = Get-ItemPropertyValue 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion' CurrentBuild
|
||||||
|
|
||||||
Clear-Host
|
PrintHeader 'Custom Configuration'
|
||||||
Write-Output "-------------------------------------------------------------------------------------------"
|
|
||||||
Write-Output " Win11Debloat Script - Custom Configuration"
|
|
||||||
Write-Output "-------------------------------------------------------------------------------------------"
|
|
||||||
|
|
||||||
if ($( Read-Host -Prompt "Remove pre-installed bloatware apps? (y/n)" ) -eq 'y') {
|
if ($( Read-Host -Prompt "Remove pre-installed bloatware apps? (y/n)" ) -eq 'y') {
|
||||||
$PSBoundParameters.Add('RemoveApps', $RemoveApps)
|
AddParameter 'RemoveApps' 'Remove bloatware apps'
|
||||||
|
|
||||||
# Show options for removing communication-related apps, only continue on valid input
|
# Show options for removing communication-related apps, only continue on valid input
|
||||||
Do {
|
Do {
|
||||||
@@ -289,67 +375,67 @@ if ((-not $PSBoundParameters.Count) -or $RunDefaults -or $RunWin11Defaults -or (
|
|||||||
# Select correct taskbar search option based on user input
|
# Select correct taskbar search option based on user input
|
||||||
switch ($RemoveCommAppInput) {
|
switch ($RemoveCommAppInput) {
|
||||||
'1' {
|
'1' {
|
||||||
$PSBoundParameters.Add('RemoveCommApps', $RemoveCommApps)
|
AddParameter 'RemoveCommApps' 'Remove the Mail, Calender, and People apps'
|
||||||
$PSBoundParameters.Add('RemoveW11Outlook', $RemoveW11Outlook)
|
AddParameter 'RemoveW11Outlook' 'Remove the new Outlook for Windows app'
|
||||||
}
|
}
|
||||||
'2' {
|
'2' {
|
||||||
$PSBoundParameters.Add('RemoveCommApps', $RemoveCommApps)
|
AddParameter 'RemoveCommApps' 'Remove the Mail, Calender, and People apps'
|
||||||
}
|
}
|
||||||
'3' {
|
'3' {
|
||||||
$PSBoundParameters.Add('RemoveW11Outlook', $RemoveW11Outlook)
|
AddParameter 'RemoveW11Outlook' 'Remove the new Outlook for Windows app'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Write-Output ""
|
Write-Output ""
|
||||||
|
|
||||||
if ($( Read-Host -Prompt " Also remove gaming-related apps such as the Xbox App and Xbox Gamebar? (y/n)" ) -eq 'y') {
|
if ($( Read-Host -Prompt " Also remove gaming-related apps such as the Xbox App and Xbox Gamebar? (y/n)" ) -eq 'y') {
|
||||||
$PSBoundParameters.Add('RemoveGamingApps', $RemoveGamingApps)
|
AddParameter 'RemoveGamingApps' 'Remove the Xbox App and Xbox Gamebar'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Only show this option for windows 11 users running build 22621 or later
|
# Only show this option for windows 11 users running build 22621 or later
|
||||||
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 ($( 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') {
|
||||||
$PSBoundParameters.Add('ClearStart', $ClearStart)
|
AddParameter 'ClearStart' 'Remove all pinned apps from the start menu for new and existing users'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Write-Output ""
|
Write-Output ""
|
||||||
|
|
||||||
if ($( Read-Host -Prompt "Disable telemetry, diagnostic data, app-launch tracking and targeted ads? (y/n)" ) -eq 'y') {
|
if ($( Read-Host -Prompt "Disable telemetry, diagnostic data, app-launch tracking and targeted ads? (y/n)" ) -eq 'y') {
|
||||||
$PSBoundParameters.Add('DisableTelemetry', $DisableTelemetry)
|
AddParameter 'DisableTelemetry' 'Disable telemetry, diagnostic data & targeted ads'
|
||||||
}
|
}
|
||||||
|
|
||||||
Write-Output ""
|
Write-Output ""
|
||||||
|
|
||||||
if ($( Read-Host -Prompt "Disable bing search, bing AI & cortana in windows search? (y/n)" ) -eq 'y') {
|
if ($( Read-Host -Prompt "Disable bing search, bing AI & cortana in windows search? (y/n)" ) -eq 'y') {
|
||||||
$PSBoundParameters.Add('DisableBing', $DisableBing)
|
AddParameter 'DisableBing' 'Disable bing search, bing AI & cortana in windows search'
|
||||||
}
|
}
|
||||||
|
|
||||||
Write-Output ""
|
Write-Output ""
|
||||||
|
|
||||||
if ($( Read-Host -Prompt "Disable tips, tricks, suggestions and ads in start, settings, notifications, explorer and lockscreen? (y/n)" ) -eq 'y') {
|
if ($( Read-Host -Prompt "Disable tips, tricks, suggestions and ads in start, settings, notifications, explorer and lockscreen? (y/n)" ) -eq 'y') {
|
||||||
$PSBoundParameters.Add('DisableSuggestions', $DisableSuggestions)
|
AddParameter 'DisableSuggestions' 'Disable tips, tricks, suggestions and ads in start, settings, notifications and windows explorer'
|
||||||
$PSBoundParameters.Add('DisableLockscreenTips', $DisableLockscreenTips)
|
AddParameter 'DisableLockscreenTips' 'Disable tips & tricks on the lockscreen'
|
||||||
}
|
}
|
||||||
|
|
||||||
# Only show this option for windows 11 users running build 22621 or later
|
# Only show this option for windows 11 users running build 22621 or later
|
||||||
if ($winversion -ge 22621){
|
if ($WinVersion -ge 22621){
|
||||||
Write-Output ""
|
Write-Output ""
|
||||||
|
|
||||||
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') {
|
||||||
$PSBoundParameters.Add('DisableCopilot', $DisableCopilot)
|
AddParameter 'DisableCopilot' 'Disable Windows copilot'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# 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
|
||||||
if ($winversion -ge 22000){
|
if ($WinVersion -ge 22000){
|
||||||
Write-Output ""
|
Write-Output ""
|
||||||
|
|
||||||
if ($( Read-Host -Prompt "Restore the old Windows 10 style context menu? (y/n)" ) -eq 'y') {
|
if ($( Read-Host -Prompt "Restore the old Windows 10 style context menu? (y/n)" ) -eq 'y') {
|
||||||
$PSBoundParameters.Add('RevertContextMenu', $RevertContextMenu)
|
AddParameter 'RevertContextMenu' 'Restore the old Windows 10 style context menu'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -357,11 +443,11 @@ if ((-not $PSBoundParameters.Count) -or $RunDefaults -or $RunWin11Defaults -or (
|
|||||||
|
|
||||||
if ($( Read-Host -Prompt "Do you want to make any changes to the taskbar and related services? (y/n)" ) -eq 'y') {
|
if ($( Read-Host -Prompt "Do you want to make any changes to the taskbar and related services? (y/n)" ) -eq 'y') {
|
||||||
# Only show these specific options for windows 11 users running build 22000 or later
|
# Only show these specific options for windows 11 users running build 22000 or later
|
||||||
if ($winversion -ge 22000){
|
if ($WinVersion -ge 22000){
|
||||||
Write-Output ""
|
Write-Output ""
|
||||||
|
|
||||||
if ($( Read-Host -Prompt " Align taskbar buttons to the left side? (y/n)" ) -eq 'y') {
|
if ($( Read-Host -Prompt " Align taskbar buttons to the left side? (y/n)" ) -eq 'y') {
|
||||||
$PSBoundParameters.Add('TaskbarAlignLeft', $TaskbarAlignLeft)
|
AddParameter 'TaskbarAlignLeft' 'Align taskbar icons to the left'
|
||||||
}
|
}
|
||||||
|
|
||||||
# Show options for search icon on taskbar, only continue on valid input
|
# Show options for search icon on taskbar, only continue on valid input
|
||||||
@@ -380,38 +466,38 @@ if ((-not $PSBoundParameters.Count) -or $RunDefaults -or $RunWin11Defaults -or (
|
|||||||
# Select correct taskbar search option based on user input
|
# Select correct taskbar search option based on user input
|
||||||
switch ($TbSearchInput) {
|
switch ($TbSearchInput) {
|
||||||
'1' {
|
'1' {
|
||||||
$PSBoundParameters.Add('HideSearchTb', $HideSearchTb)
|
AddParameter 'HideSearchTb' 'Hide search icon from the taskbar'
|
||||||
}
|
}
|
||||||
'2' {
|
'2' {
|
||||||
$PSBoundParameters.Add('ShowSearchIconTb', $ShowSearchIconTb)
|
AddParameter 'ShowSearchIconTb' 'Show search icon on the taskbar'
|
||||||
}
|
}
|
||||||
'3' {
|
'3' {
|
||||||
$PSBoundParameters.Add('ShowSearchLabelTb', $ShowSearchLabelTb)
|
AddParameter 'ShowSearchLabelTb' 'Show search icon with label on the taskbar'
|
||||||
}
|
}
|
||||||
'4' {
|
'4' {
|
||||||
$PSBoundParameters.Add('ShowSearchBoxTb', $ShowSearchBoxTb)
|
AddParameter 'ShowSearchBoxTb' 'Show search box on the taskbar'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Write-Output ""
|
Write-Output ""
|
||||||
|
|
||||||
if ($( Read-Host -Prompt " Hide the taskview button from the taskbar? (y/n)" ) -eq 'y') {
|
if ($( Read-Host -Prompt " Hide the taskview button from the taskbar? (y/n)" ) -eq 'y') {
|
||||||
$PSBoundParameters.Add('HideTaskview', $HideTaskview)
|
AddParameter 'HideTaskview' 'Hide the taskview button from the taskbar'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Write-Output ""
|
Write-Output ""
|
||||||
|
|
||||||
if ($( Read-Host -Prompt " Disable the widgets service and hide the icon from the taskbar? (y/n)" ) -eq 'y') {
|
if ($( Read-Host -Prompt " Disable the widgets service and hide the icon from the taskbar? (y/n)" ) -eq 'y') {
|
||||||
$PSBoundParameters.Add('DisableWidgets', $DisableWidgets)
|
AddParameter 'DisableWidgets' 'Disable the widget service & hide the widget (news and interests) icon from the taskbar'
|
||||||
}
|
}
|
||||||
|
|
||||||
# Only show this options for windows users running build 22621 or earlier
|
# Only show this options for windows users running build 22621 or earlier
|
||||||
if ($winversion -le 22621){
|
if ($WinVersion -le 22621){
|
||||||
Write-Output ""
|
Write-Output ""
|
||||||
|
|
||||||
if ($( Read-Host -Prompt " Hide the chat (meet now) icon from the taskbar? (y/n)" ) -eq 'y') {
|
if ($( Read-Host -Prompt " Hide the chat (meet now) icon from the taskbar? (y/n)" ) -eq 'y') {
|
||||||
$PSBoundParameters.Add('HideChat', $HideChat)
|
AddParameter 'HideChat' 'Hide the chat (meet now) icon from the taskbar'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -422,19 +508,19 @@ if ((-not $PSBoundParameters.Count) -or $RunDefaults -or $RunWin11Defaults -or (
|
|||||||
Write-Output ""
|
Write-Output ""
|
||||||
|
|
||||||
if ($( Read-Host -Prompt " Show hidden files, folders and drives? (y/n)" ) -eq 'y') {
|
if ($( Read-Host -Prompt " Show hidden files, folders and drives? (y/n)" ) -eq 'y') {
|
||||||
$PSBoundParameters.Add('ShowHiddenFolders', $ShowHiddenFolders)
|
AddParameter 'ShowHiddenFolders' 'Show hidden files, folders and drives'
|
||||||
}
|
}
|
||||||
|
|
||||||
Write-Output ""
|
Write-Output ""
|
||||||
|
|
||||||
if ($( Read-Host -Prompt " Show file extensions for known file types? (y/n)" ) -eq 'y') {
|
if ($( Read-Host -Prompt " Show file extensions for known file types? (y/n)" ) -eq 'y') {
|
||||||
$PSBoundParameters.Add('ShowKnownFileExt', $ShowKnownFileExt)
|
AddParameter 'ShowKnownFileExt' 'Show file extensions for known file types'
|
||||||
}
|
}
|
||||||
|
|
||||||
Write-Output ""
|
Write-Output ""
|
||||||
|
|
||||||
if ($( Read-Host -Prompt " Hide duplicate removable drive entries from the windows explorer sidepane so they only show under This PC? (y/n)" ) -eq 'y') {
|
if ($( Read-Host -Prompt " Hide duplicate removable drive entries from the windows explorer sidepane so they only show under This PC? (y/n)" ) -eq 'y') {
|
||||||
$PSBoundParameters.Add('HideDupliDrive', $HideDupliDrive)
|
AddParameter 'HideDupliDrive' 'Hide duplicate removable drive entries from the windows explorer navigation pane'
|
||||||
}
|
}
|
||||||
|
|
||||||
# Only show option for disabling these specific folders for windows 10 users
|
# Only show option for disabling these specific folders for windows 10 users
|
||||||
@@ -445,19 +531,19 @@ if ((-not $PSBoundParameters.Count) -or $RunDefaults -or $RunWin11Defaults -or (
|
|||||||
Write-Output ""
|
Write-Output ""
|
||||||
|
|
||||||
if ($( Read-Host -Prompt " Hide the onedrive folder from the windows explorer sidepane? (y/n)" ) -eq 'y') {
|
if ($( Read-Host -Prompt " Hide the onedrive folder from the windows explorer sidepane? (y/n)" ) -eq 'y') {
|
||||||
$PSBoundParameters.Add('HideOnedrive', $HideOnedrive)
|
AddParameter 'HideOnedrive' 'Hide the onedrive folder in the windows explorer sidepanel'
|
||||||
}
|
}
|
||||||
|
|
||||||
Write-Output ""
|
Write-Output ""
|
||||||
|
|
||||||
if ($( Read-Host -Prompt " Hide the 3D objects folder from the windows explorer sidepane? (y/n)" ) -eq 'y') {
|
if ($( Read-Host -Prompt " Hide the 3D objects folder from the windows explorer sidepane? (y/n)" ) -eq 'y') {
|
||||||
$PSBoundParameters.Add('Hide3dObjects', $Hide3dObjects)
|
AddParameter 'Hide3dObjects' "Hide the 3D objects folder under 'This pc' in windows explorer"
|
||||||
}
|
}
|
||||||
|
|
||||||
Write-Output ""
|
Write-Output ""
|
||||||
|
|
||||||
if ($( Read-Host -Prompt " Hide the music folder from the windows explorer sidepane? (y/n)" ) -eq 'y') {
|
if ($( Read-Host -Prompt " Hide the music folder from the windows explorer sidepane? (y/n)" ) -eq 'y') {
|
||||||
$PSBoundParameters.Add('HideMusic', $HideMusic)
|
AddParameter 'HideMusic' "Hide the music folder under 'This pc' in windows explorer"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -471,19 +557,19 @@ if ((-not $PSBoundParameters.Count) -or $RunDefaults -or $RunWin11Defaults -or (
|
|||||||
Write-Output ""
|
Write-Output ""
|
||||||
|
|
||||||
if ($( Read-Host -Prompt " Hide the 'Include in library' option in the context menu? (y/n)" ) -eq 'y') {
|
if ($( Read-Host -Prompt " Hide the 'Include in library' option in the context menu? (y/n)" ) -eq 'y') {
|
||||||
$PSBoundParameters.Add('HideIncludeInLibrary', $HideIncludeInLibrary)
|
AddParameter 'HideIncludeInLibrary' "Hide the 'Include in library' option in the context menu"
|
||||||
}
|
}
|
||||||
|
|
||||||
Write-Output ""
|
Write-Output ""
|
||||||
|
|
||||||
if ($( Read-Host -Prompt " Hide the 'Give access to' option in the context menu? (y/n)" ) -eq 'y') {
|
if ($( Read-Host -Prompt " Hide the 'Give access to' option in the context menu? (y/n)" ) -eq 'y') {
|
||||||
$PSBoundParameters.Add('HideGiveAccessTo', $HideGiveAccessTo)
|
AddParameter 'HideGiveAccessTo' "Hide the 'Give access to' option in the context menu"
|
||||||
}
|
}
|
||||||
|
|
||||||
Write-Output ""
|
Write-Output ""
|
||||||
|
|
||||||
if ($( Read-Host -Prompt " Hide the 'Share' option in the context menu? (y/n)" ) -eq 'y') {
|
if ($( Read-Host -Prompt " Hide the 'Share' option in the context menu? (y/n)" ) -eq 'y') {
|
||||||
$PSBoundParameters.Add('HideShare', $HideShare)
|
AddParameter 'HideShare' "Hide the 'Share' option in the context menu"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -497,18 +583,17 @@ if ((-not $PSBoundParameters.Count) -or $RunDefaults -or $RunWin11Defaults -or (
|
|||||||
$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
|
$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
|
||||||
}
|
}
|
||||||
|
|
||||||
Clear-Host
|
PrintHeader 'Custom Configuration'
|
||||||
Write-Output "-------------------------------------------------------------------------------------------"
|
}
|
||||||
Write-Output " Win11Debloat Script - Custom Configuration"
|
|
||||||
Write-Output "-------------------------------------------------------------------------------------------"
|
# Run with options from last time, loaded from file
|
||||||
|
'3' {
|
||||||
|
PrintHeader 'Custom Configuration'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Clear-Host
|
PrintHeader 'Custom Configuration'
|
||||||
Write-Output "-------------------------------------------------------------------------------------------"
|
|
||||||
Write-Output " Win11Debloat Script - Custom Configuration"
|
|
||||||
Write-Output "-------------------------------------------------------------------------------------------"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -532,8 +617,8 @@ else {
|
|||||||
'RemoveCommApps' {
|
'RemoveCommApps' {
|
||||||
Write-Output "> Removing Mail, Calendar and People apps..."
|
Write-Output "> Removing Mail, Calendar and People apps..."
|
||||||
|
|
||||||
$appsList = '*Microsoft.windowscommunicationsapps*', '*Microsoft.People*'
|
$AppsList = '*Microsoft.windowscommunicationsapps*', '*Microsoft.People*'
|
||||||
RemoveSpecificApps $appsList
|
RemoveSpecificApps $AppsList
|
||||||
|
|
||||||
Write-Output ""
|
Write-Output ""
|
||||||
continue
|
continue
|
||||||
@@ -541,14 +626,20 @@ else {
|
|||||||
'RemoveW11Outlook' {
|
'RemoveW11Outlook' {
|
||||||
Write-Output "> Removing new Outlook for Windows app..."
|
Write-Output "> Removing new Outlook for Windows app..."
|
||||||
|
|
||||||
$appsList = '*Microsoft.OutlookForWindows*'
|
$AppsList = '*Microsoft.OutlookForWindows*'
|
||||||
RemoveSpecificApps $appsList
|
RemoveSpecificApps $AppsList
|
||||||
|
|
||||||
Write-Output ""
|
Write-Output ""
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
'RemoveGamingApps' {
|
'RemoveGamingApps' {
|
||||||
RemoveApps "$PSScriptRoot/GamingAppslist.txt" "> Removing gaming-related windows apps..."
|
Write-Output "> Removing gaming related apps..."
|
||||||
|
|
||||||
|
$AppsList = '*Microsoft.GamingApp*', '*Microsoft.XboxGameOverlay*', '*Microsoft.XboxGamingOverlay*'
|
||||||
|
RemoveSpecificApps $AppsList
|
||||||
|
|
||||||
|
Write-Output ""
|
||||||
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
'ClearStart' {
|
'ClearStart' {
|
||||||
|
|||||||
Reference in New Issue
Block a user