Win 2
Win 2
[switch]$ClearStartAllUsers,
[switch]$RevertContextMenu,
[switch]$HideGallery,
[switch]$DisableOnedrive, [switch]$HideOnedrive,
[switch]$Disable3dObjects, [switch]$Hide3dObjects,
[switch]$DisableMusic, [switch]$HideMusic,
[switch]$DisableIncludeInLibrary, [switch]$HideIncludeInLibrary,
[switch]$DisableGiveAccessTo, [switch]$HideGiveAccessTo,
[switch]$DisableShare, [switch]$HideShare
)
# Show error if current powershell environment does not have LanguageMode set to FullLanguage
if ($ExecutionContext.SessionState.LanguageMode -ne "FullLanguage") {
Write-Host "Error: Win11Debloat is unable to run on your system, powershell execution is restricted
by security policies" -ForegroundColor Red
Write-Output ""
Write-Output "Press enter to exit..."
Read-Host | Out-Null
Exit
}
# Shows application selection form that allows the user to select what apps they want to remove or keep
function ShowAppSelectionForm {
[reflection.assembly]::loadwithpartialname("System.Windows.Forms") | Out-Null
[reflection.assembly]::loadwithpartialname("System.Drawing") | Out-Null
# Initialise form objects
$form = New-Object System.Windows.Forms.Form
$label = New-Object System.Windows.Forms.Label
$button1 = New-Object System.Windows.Forms.Button
$button2 = New-Object System.Windows.Forms.Button
$selectionBox = New-Object System.Windows.Forms.CheckedListBox
$loadingLabel = New-Object System.Windows.Forms.Label
$onlyInstalledCheckBox = New-Object System.Windows.Forms.CheckBox
$checkUncheckCheckBox = New-Object System.Windows.Forms.CheckBox
$initialFormWindowState = New-Object System.Windows.Forms.FormWindowState
$global:selectionBoxIndex = -1
# saveButton eventHandler
$handler_saveButton_Click=
{
$global:SelectedApps = $selectionBox.CheckedItems
$form.Close()
}
# cancelButton eventHandler
$handler_cancelButton_Click=
{
$form.Close()
}
$selectionBox_SelectedIndexChanged=
{
$global:selectionBoxIndex = $selectionBox.SelectedIndex
}
$selectionBox_MouseDown=
{
if ($_.Button -eq [System.Windows.Forms.MouseButtons]::Left) {
if([System.Windows.Forms.Control]::ModifierKeys -eq [System.Windows.Forms.Keys]::Shift) {
if($global:selectionBoxIndex -ne -1) {
$topIndex = $global:selectionBoxIndex
$check_All=
{
for(($i = 0); $i -lt $selectionBox.Items.Count; $i++){
$selectionBox.SetItemChecked($i, $checkUncheckCheckBox.Checked)
}
}
$load_Apps=
{
# Correct the initial state of the form to prevent the .Net maximized form issue
$form.WindowState = $initialFormWindowState
if (-not $jobDone) {
# Show error that the script was unable to get list of apps from winget
[System.Windows.MessageBox]::Show('Unable to load list of installed apps via winget, some
apps may not be displayed in the list.','Error','Ok','Error')
}
else {
# Add output of job (list of apps) to $listOfApps
$listOfApps = Receive-Job -Job $job
}
}
$appString = $app.Trim('*')
# Add the app to the selectionBox and set it's checked status
$selectionBox.Items.Add($appString, $appChecked) | Out-Null
}
}
$button1.TabIndex = 4
$button1.Name = "saveButton"
$button1.DialogResult = [System.Windows.Forms.DialogResult]::OK
$button1.UseVisualStyleBackColor = $True
$button1.Text = "Confirm"
$button1.Location = New-Object System.Drawing.Point(27,472)
$button1.Size = New-Object System.Drawing.Size(75,23)
$button1.DataBindings.DefaultDataSourceUpdateMode = 0
$button1.add_Click($handler_saveButton_Click)
$form.Controls.Add($button1)
$button2.TabIndex = 5
$button2.Name = "cancelButton"
$button2.DialogResult = [System.Windows.Forms.DialogResult]::Cancel
$button2.UseVisualStyleBackColor = $True
$button2.Text = "Cancel"
$button2.Location = New-Object System.Drawing.Point(129,472)
$button2.Size = New-Object System.Drawing.Size(75,23)
$button2.DataBindings.DefaultDataSourceUpdateMode = 0
$button2.add_Click($handler_cancelButton_Click)
$form.Controls.Add($button2)
$form.Controls.Add($label)
$form.Controls.Add($loadingLabel)
$onlyInstalledCheckBox.TabIndex = 6
$onlyInstalledCheckBox.Location = New-Object System.Drawing.Point(230,474)
$onlyInstalledCheckBox.Size = New-Object System.Drawing.Size(150,20)
$onlyInstalledCheckBox.Text = 'Only show installed apps'
$onlyInstalledCheckBox.add_CheckedChanged($load_Apps)
$form.Controls.Add($onlyInstalledCheckBox)
$checkUncheckCheckBox.TabIndex = 7
$checkUncheckCheckBox.Location = New-Object System.Drawing.Point(16,22)
$checkUncheckCheckBox.Size = New-Object System.Drawing.Size(150,20)
$checkUncheckCheckBox.Text = 'Check/Uncheck all'
$checkUncheckCheckBox.add_CheckedChanged($check_All)
$form.Controls.Add($checkUncheckCheckBox)
$selectionBox.FormattingEnabled = $True
$selectionBox.DataBindings.DefaultDataSourceUpdateMode = 0
$selectionBox.Name = "selectionBox"
$selectionBox.Location = New-Object System.Drawing.Point(13,43)
$selectionBox.Size = New-Object System.Drawing.Size(374,424)
$selectionBox.TabIndex = 3
$selectionBox.add_SelectedIndexChanged($selectionBox_SelectedIndexChanged)
$selectionBox.add_Click($selectionBox_MouseDown)
$form.Controls.Add($selectionBox)
# Reads list of apps from file and removes them for all user accounts and from the OS image.
function RemoveAppsFromFile {
param (
$appsFilePath
)
$appsList = @()
# Get list of apps from file at the path provided, and remove them one by one
Foreach ($app in (Get-Content -Path $appsFilePath | Where-Object { $_ -notmatch '^#.*' -and $_ -
notmatch '^\s*$' } )) {
# Remove any spaces before and after the Appname
$app = $app.Trim()
$appString = $app.Trim('*')
$appsList += $appString
}
RemoveApps $appsList
}
# Removes apps specified during function call from all user accounts and from the OS image.
function RemoveApps {
param (
$appslist
)
# Remove provisioned app from OS image, so the app won't be installed for any new users
Get-AppxProvisionedPackage -Online | Where-Object { $_.PackageName -like $app } | ForEach-
Object { Remove-ProvisionedAppxPackage -Online -AllUsers -PackageName $_.PackageName }
}
}
}
function ForceRemoveEdge {
# Based on work from loadstring1 & ave9858
Write-Output "> Forcefully uninstalling Microsoft Edge..."
$regView = [Microsoft.Win32.RegistryView]::Registry32
$hklm =
[Microsoft.Win32.RegistryKey]::OpenBaseKey([Microsoft.Win32.RegistryHive]::LocalMachine,
$regView)
$hklm.CreateSubKey('SOFTWARE\Microsoft\EdgeUpdateDev').SetValue('AllowUninstall', '')
# Remove edge
$uninstallRegKey = $hklm.OpenSubKey('SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\
Microsoft Edge')
if($uninstallRegKey -ne $null) {
Write-Output "Running uninstaller..."
$uninstallString = $uninstallRegKey.GetValue('UninstallString') + ' --force-uninstall'
Start-Process cmd.exe "/c $uninstallString" -WindowStyle Hidden -Wait
$appdata = $([Environment]::GetFolderPath('ApplicationData'))
$edgePaths = @(
"$env:ProgramData\Microsoft\Windows\Start Menu\Programs\Microsoft Edge.lnk",
"$env:APPDATA\Microsoft\Internet Explorer\Quick Launch\Microsoft Edge.lnk",
"$env:APPDATA\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\Microsoft
Edge.lnk",
"$env:PUBLIC\Desktop\Microsoft Edge.lnk",
"$env:USERPROFILE\Desktop\Microsoft Edge.lnk",
"$appdata\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\Tombstones\
Microsoft Edge.lnk",
"$appdata\Microsoft\Internet Explorer\Quick Launch\Microsoft Edge.lnk",
"$edgeStub"
)
Write-Output ""
}
# Execute provided command and strips progress spinners/bars from console output
function Strip-Progress {
param(
[ScriptBlock]$ScriptBlock
)
# Corrected regex pattern for size formatting, ensuring proper capture groups are utilized
$sizePattern = '(\d+(\.\d{1,2})?)\s+(B|KB|MB|GB|TB|PB) /\s+(\d+(\.\d{1,2})?)\s+(B|KB|MB|GB|TB|
PB)'
Write-Output $message
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 $message
if ($applyToAllUsers) {
# Remove startmenu pinned apps for all users
# Get all user profile folders
$usersStartMenu = get-childitem -path "C:\Users\*\AppData\Local\Packages\
Microsoft.Windows.StartMenuExperienceHost_cw5n1h2txyewy\LocalState"
$global:FirstSelection = $false
function PrintHeader {
param (
$title
)
if($global:Params.ContainsKey("Sysprep")) {
$fullTitle = "$fullTitle (Sysprep mode)"
}
Clear-Host
Write-Output "-------------------------------------------------------------------------------------------"
Write-Output $fullTitle
Write-Output "-------------------------------------------------------------------------------------------"
}
function PrintFromFile {
param (
$path
)
Clear-Host
function AwaitKeyToExit {
# Suppress prompt if Silent parameter was passed
if (-not $Silent) {
Write-Output ""
Write-Output "Press any key to exit..."
$null = [System.Console]::ReadKey()
}
}
#####################################################################################
#############################
# #
# SCRIPT START #
# #
#####################################################################################
#############################
# 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)) {
$global:wingetInstalled = $true
}
else {
$global:wingetInstalled = $false
# Show warning that requires user confirmation, Suppress confirmation if Silent parameter was passed
if (-not $Silent) {
Write-Warning "Winget is not installed or outdated. This may prevent Win11Debloat from removing
certain apps."
Write-Output ""
Write-Output "Press any key to continue anyway..."
$null = [System.Console]::ReadKey()
}
}
# Hide progress bars for app removal, as they block Win11Debloat's output
$ProgressPreference = 'SilentlyContinue'
$global:Params = $PSBoundParameters
$global:FirstSelection = $true
$SPParams = 'WhatIf', 'Confirm', 'Verbose', 'Silent', 'Sysprep'
$SPParamCount = 0
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
}
}
# Only run the app selection form if the 'RunAppConfigurator' parameter was passed to the script
if ($RunAppConfigurator) {
PrintHeader "App Configurator"
$result = ShowAppSelectionForm
# Show different message based on whether the app selection was saved or cancelled
if ($result -ne [System.Windows.Forms.DialogResult]::OK) {
Write-Host "App configurator was closed without saving." -ForegroundColor Red
}
else {
Write-Output "Your app selection was saved to the 'CustomAppsList' file in the root folder of the
script."
}
AwaitKeyToExit
Exit
}
# Change script execution based on provided parameters or user input
if ((-not $global:Params.Count) -or $RunDefaults -or $RunWin11Defaults -or ($SPParamCount -eq
$global:Params.Count)) {
if ($RunDefaults -or $RunWin11Defaults) {
$Mode = '1'
}
else {
# Show menu and wait for user input, loops until valid input is provided
Do {
$ModeSelectionMessage = "Please select an option (1/2/3/0)"
PrintHeader 'Menu'
Write-Output ""
Write-Output "(0) Show more information"
Write-Output ""
Write-Output ""
Write-Output ""
Write-Output "Press any key to go back..."
$null = [System.Console]::ReadKey()
}
elseif (($Mode -eq '4')-and -not (Test-Path "$PSScriptRoot/SavedSettings")) {
$Mode = $null
}
}
while ($Mode -ne '1' -and $Mode -ne '2' -and $Mode -ne '3' -and $Mode -ne '4')
}
Write-Output ""
Write-Output "Press enter to execute the script or press CTRL+C to quit..."
Read-Host | Out-Null
}
$DefaultParameterNames =
'RemoveApps','DisableTelemetry','DisableBing','DisableLockscreenTips','DisableSuggestions','ShowKno
wnFileExt','DisableWidgets','HideChat','DisableCopilot'
# Only add this option for Windows 10 users, if it doesn't already exist
if ((get-ciminstance -query "select caption from win32_operatingsystem where caption like
'%Windows 10%'") -and (-not $global:Params.ContainsKey('Hide3dObjects'))) {
$global:Params.Add('Hide3dObjects', $Hide3dObjects)
}
}
$RemoveAppsInput = 'c'
}
Write-Output ""
}
}
while ($RemoveAppsInput -ne 'n' -and $RemoveAppsInput -ne '0' -and $RemoveAppsInput -ne '1'
-and $RemoveAppsInput -ne '2' -and $RemoveAppsInput -ne '3')
Write-Output ""
if ($( Read-Host -Prompt "Disable Xbox game/screen recording? Also stops gaming overlay
popups (y/n)" ) -eq 'y') {
AddParameter 'DisableDVR' 'Disable Xbox game/screen recording'
}
}
}
# Only show this option for Windows 11 users running build 22621 or later
if ($WinVersion -ge 22621){
Write-Output ""
if ($global:Params.ContainsKey("Sysprep")) {
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)"
}
while ($ClearStartInput -ne 'n' -and $ClearStartInput -ne '0' -and $ClearStartInput -ne '1' -and
$ClearStartInput -ne '2')
if ($( Read-Host -Prompt "Disable telemetry, diagnostic data, activity history, app-launch tracking
and targeted ads? (y/n)" ) -eq 'y') {
AddParameter 'DisableTelemetry' 'Disable telemetry, diagnostic data, activity history, app-
launch tracking & targeted ads'
}
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 File Explorer'
AddParameter 'DisableLockscreenTips' 'Disable tips & tricks on the lockscreen'
}
Write-Output ""
if ($( Read-Host -Prompt "Disable & remove bing web search, bing AI & cortana in Windows
search? (y/n)" ) -eq 'y') {
AddParameter 'DisableBing' 'Disable & remove bing web search, bing AI & cortana in
Windows search'
}
# Only show this option for Windows 11 users running build 22621 or later
if ($WinVersion -ge 22621){
Write-Output ""
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
if ($WinVersion -ge 22000){
Write-Output ""
if ($( Read-Host -Prompt "Restore the old Windows 10 style context menu? (y/n)" ) -eq 'y') {
AddParameter 'RevertContextMenu' 'Restore the old Windows 10 style context menu'
}
}
Write-Output ""
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
if ($WinVersion -ge 22000){
Write-Output ""
if ($( Read-Host -Prompt " Align taskbar buttons to the left side? (y/n)" ) -eq 'y') {
AddParameter 'TaskbarAlignLeft' 'Align taskbar icons to the left'
}
# Show options for search icon on taskbar, only continue on valid input
Do {
Write-Output ""
Write-Host " Options:" -ForegroundColor Yellow
Write-Host " (n) No change" -ForegroundColor Yellow
Write-Host " (1) Hide search icon from the taskbar" -ForegroundColor Yellow
Write-Host " (2) Show search icon on the taskbar" -ForegroundColor Yellow
Write-Host " (3) Show search icon with label on the taskbar" -ForegroundColor Yellow
Write-Host " (4) Show search box on the taskbar" -ForegroundColor Yellow
$TbSearchInput = Read-Host " Hide or change the search icon on the taskbar?
(n/1/2/3/4)"
}
while ($TbSearchInput -ne 'n' -and $TbSearchInput -ne '0' -and $TbSearchInput -ne '1' -and
$TbSearchInput -ne '2' -and $TbSearchInput -ne '3' -and $TbSearchInput -ne '4')
Write-Output ""
if ($( Read-Host -Prompt " Hide the taskview button from the taskbar? (y/n)" ) -eq 'y') {
AddParameter 'HideTaskview' 'Hide the taskview button from the taskbar'
}
}
Write-Output ""
if ($( Read-Host -Prompt " Disable the widgets service and hide the icon from the taskbar?
(y/n)" ) -eq 'y') {
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
if ($WinVersion -le 22621){
Write-Output ""
if ($( Read-Host -Prompt " Hide the chat (meet now) icon from the taskbar? (y/n)" ) -eq 'y')
{
AddParameter 'HideChat' 'Hide the chat (meet now) icon from the taskbar'
}
}
}
Write-Output ""
if ($( Read-Host -Prompt "Do you want to make any changes to File Explorer? (y/n)" ) -eq 'y') {
Write-Output ""
if ($( Read-Host -Prompt " Show hidden files, folders and drives? (y/n)" ) -eq 'y') {
AddParameter 'ShowHiddenFolders' 'Show hidden files, folders and drives'
}
Write-Output ""
if ($( Read-Host -Prompt " Show file extensions for known file types? (y/n)" ) -eq 'y') {
AddParameter 'ShowKnownFileExt' 'Show file extensions for known file types'
}
# Only show this option for Windows 11 users running build 22000 or later
if ($WinVersion -ge 22000){
Write-Output ""
if ($( Read-Host -Prompt " Hide the gallery section from the File Explorer sidepanel? (y/n)"
) -eq 'y') {
AddParameter 'HideGallery' 'Hide the gallery section from the File Explorer sidepanel'
}
}
Write-Output ""
if ($( Read-Host -Prompt " Hide duplicate removable drive entries from the File Explorer
sidepanel so they only show under This PC? (y/n)" ) -eq 'y') {
AddParameter 'HideDupliDrive' 'Hide duplicate removable drive entries from the File
Explorer sidepanel'
}
# Only show option for disabling these specific folders for Windows 10 users
if (get-ciminstance -query "select caption from win32_operatingsystem where caption like
'%Windows 10%'"){
Write-Output ""
if ($( Read-Host -Prompt "Do you want to hide any folders from the File Explorer sidepanel?
(y/n)" ) -eq 'y') {
Write-Output ""
if ($( Read-Host -Prompt " Hide the onedrive folder from the File Explorer sidepanel?
(y/n)" ) -eq 'y') {
AddParameter 'HideOnedrive' 'Hide the onedrive folder in the File Explorer sidepanel'
}
Write-Output ""
if ($( Read-Host -Prompt " Hide the 3D objects folder from the File Explorer sidepanel?
(y/n)" ) -eq 'y') {
AddParameter 'Hide3dObjects' "Hide the 3D objects folder under 'This pc' in File
Explorer"
}
Write-Output ""
if ($( Read-Host -Prompt " Hide the music folder from the File Explorer sidepanel? (y/n)"
) -eq 'y') {
AddParameter 'HideMusic' "Hide the music folder under 'This pc' in File Explorer"
}
}
}
}
# Only show option for disabling context menu items for Windows 10 users or if the user opted to
restore the Windows 10 context menu
if ((get-ciminstance -query "select caption from win32_operatingsystem where caption like
'%Windows 10%'") -or $global:Params.ContainsKey('RevertContextMenu')){
Write-Output ""
if ($( Read-Host -Prompt "Do you want to disable any context menu options? (y/n)" ) -eq 'y') {
Write-Output ""
if ($( Read-Host -Prompt " Hide the 'Include in library' option in the context menu? (y/n)" )
-eq 'y') {
AddParameter 'HideIncludeInLibrary' "Hide the 'Include in library' option in the context
menu"
}
Write-Output ""
if ($( Read-Host -Prompt " Hide the 'Give access to' option in the context menu? (y/n)" ) -eq
'y') {
AddParameter 'HideGiveAccessTo' "Hide the 'Give access to' option in the context menu"
}
Write-Output ""
if ($( Read-Host -Prompt " Hide the 'Share' option in the context menu? (y/n)" ) -eq 'y') {
AddParameter 'HideShare' "Hide the 'Share' option in the context menu"
}
}
}
$result = ShowAppSelectionForm
if (-not $global:Params.ContainsKey($ParameterName)){
$global:Params.Add($paramName, $true)
}
}
}
Write-Output ""
Write-Output ""
Write-Output "Press enter to execute the script or press CTRL+C to quit..."
Read-Host | Out-Null
}
# If the number of keys in SPParams equals the number of keys in Params then no modifications/changes
were selected
# or added by the user, and the script can exit without making any changes.
if ($SPParamCount -eq $global:Params.Keys.Count) {
Write-Output "The script completed without making any changes."
AwaitKeyToExit
}
else {
# Execute all selected/provided parameters
switch ($global:Params.Keys) {
'RemoveApps' {
RemoveAppsFromFile "$PSScriptRoot/Appslist.txt"
continue
}
'RemoveAppsCustom' {
if (Test-Path "$PSScriptRoot/CustomAppsList") {
$appsList = @()
$appsList += $app
}
Write-Output "> Removing $($appsList.Count) apps..."
RemoveApps $appsList
}
else {
Write-Host "> Could not load custom apps list from file, no apps were removed!" -
ForegroundColor Red
}
Write-Output ""
continue
}
'RemoveCommApps' {
Write-Output "> Removing Mail, Calendar and People apps..."
Write-Output ""
continue
}
'RemoveW11Outlook' {
Write-Output "> Removing new Outlook for Windows app..."
$appsList = 'Microsoft.OutlookForWindows'
RemoveApps $appsList
Write-Output ""
continue
}
'RemoveDevApps' {
Write-Output "> Removing developer-related related apps..."
Write-Output ""
continue
}
'RemoveGamingApps' {
Write-Output "> Removing gaming related apps..."
Write-Output ""
continue
}
"ForceRemoveEdge" {
ForceRemoveEdge
continue
}
'DisableDVR' {
RegImport "> Disabling Xbox game/screen recording..." "Disable_DVR.reg"
continue
}
'ClearStart' {
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
}
'DisableTelemetry' {
RegImport "> Disabling telemetry, diagnostic data, activity history, app-launch tracking and
targeted ads..." "Disable_Telemetry.reg"
continue
}
{$_ -in "DisableBingSearches", "DisableBing"} {
RegImport "> Disabling bing web search, bing AI & cortana in Windows search..."
"Disable_Bing_Cortana_In_Search.reg"
Write-Output ""
continue
}
{$_ -in "DisableLockscrTips", "DisableLockscreenTips"} {
RegImport "> Disabling tips & tricks on the lockscreen..." "Disable_Lockscreen_Tips.reg"
continue
}
{$_ -in "DisableSuggestions", "DisableWindowsSuggestions"} {
RegImport "> Disabling tips, tricks, suggestions and ads across Windows..."
"Disable_Windows_Suggestions.reg"
continue
}
'RevertContextMenu' {
RegImport "> Restoring the old Windows 10 style context menu..."
"Disable_Show_More_Options_Context_Menu.reg"
continue
}
'TaskbarAlignLeft' {
RegImport "> Aligning taskbar buttons to the left..." "Align_Taskbar_Left.reg"
continue
}
'HideSearchTb' {
RegImport "> Hiding the search icon from the taskbar..." "Hide_Search_Taskbar.reg"
continue
}
'ShowSearchIconTb' {
RegImport "> Changing taskbar search to icon only..." "Show_Search_Icon.reg"
continue
}
'ShowSearchLabelTb' {
RegImport "> Changing taskbar search to icon with label..." "Show_Search_Icon_And_Label.reg"
continue
}
'ShowSearchBoxTb' {
RegImport "> Changing taskbar search to search box..." "Show_Search_Box.reg"
continue
}
'HideTaskview' {
RegImport "> Hiding the taskview button from the taskbar..." "Hide_Taskview_Taskbar.reg"
continue
}
'DisableCopilot' {
RegImport "> Disabling Windows copilot..." "Disable_Copilot.reg"
continue
}
'DisableRecall' {
RegImport "> Disabling Windows Recall snapshots..." "Disable_AI_Recall.reg"
continue
}
{$_ -in "HideWidgets", "DisableWidgets"} {
RegImport "> Disabling the widget service and hiding the widget icon from the taskbar..."
"Disable_Widgets_Taskbar.reg"
continue
}
{$_ -in "HideChat", "DisableChat"} {
RegImport "> Hiding the chat icon from the taskbar..." "Disable_Chat_Taskbar.reg"
continue
}
'ShowHiddenFolders' {
RegImport "> Unhiding hidden files, folders and drives..." "Show_Hidden_Folders.reg"
continue
}
'ShowKnownFileExt' {
RegImport "> Enabling file extensions for known file types..."
"Show_Extensions_For_Known_File_Types.reg"
continue
}
'HideGallery' {
RegImport "> Hiding the gallery section from the File Explorer navigation pane..."
"Hide_Gallery_from_Explorer.reg"
continue
}
'HideDupliDrive' {
RegImport "> Hiding duplicate removable drive entries from the File Explorer navigation pane..."
"Hide_duplicate_removable_drives_from_navigation_pane_of_File_Explorer.reg"
continue
}
{$_ -in "HideOnedrive", "DisableOnedrive"} {
RegImport "> Hiding the onedrive folder from the File Explorer navigation pane..."
"Hide_Onedrive_Folder.reg"
continue
}
{$_ -in "Hide3dObjects", "Disable3dObjects"} {
RegImport "> Hiding the 3D objects folder from the File Explorer navigation pane..."
"Hide_3D_Objects_Folder.reg"
continue
}
{$_ -in "HideMusic", "DisableMusic"} {
RegImport "> Hiding the music folder from the File Explorer navigation pane..."
"Hide_Music_folder.reg"
continue
}
{$_ -in "HideIncludeInLibrary", "DisableIncludeInLibrary"} {
RegImport "> Hiding 'Include in library' in the context menu..."
"Disable_Include_in_library_from_context_menu.reg"
continue
}
{$_ -in "HideGiveAccessTo", "DisableGiveAccessTo"} {
RegImport "> Hiding 'Give access to' in the context menu..."
"Disable_Give_access_to_context_menu.reg"
continue
}
{$_ -in "HideShare", "DisableShare"} {
RegImport "> Hiding 'Share' in the context menu..." "Disable_Share_from_context_menu.reg"
continue
}
}
RestartExplorer
Write-Output ""
Write-Output ""
Write-Output ""
Write-Output "Script completed successfully!"
AwaitKeyToExit
}