2024-05-20 13:09:08 +02:00
|
|
|
param (
|
|
|
|
|
[switch]$Silent,
|
2024-08-17 00:08:09 +02:00
|
|
|
[switch]$Verbose,
|
2024-06-27 23:08:43 +02:00
|
|
|
[switch]$Sysprep,
|
2025-05-10 13:02:48 +02:00
|
|
|
[string]$LogPath,
|
2025-03-05 23:39:29 +01:00
|
|
|
[string]$User,
|
2025-05-03 17:55:31 +02:00
|
|
|
[switch]$CreateRestorePoint,
|
2025-04-19 15:16:47 +02:00
|
|
|
[switch]$RunAppsListGenerator, [switch]$RunAppConfigurator,
|
2025-09-13 23:36:38 +02:00
|
|
|
[switch]$RunDefaults,
|
|
|
|
|
[switch]$RunDefaultsLite,
|
2025-01-09 21:33:28 +01:00
|
|
|
[switch]$RunSavedSettings,
|
2024-05-20 13:09:08 +02:00
|
|
|
[switch]$RemoveApps,
|
|
|
|
|
[switch]$RemoveAppsCustom,
|
|
|
|
|
[switch]$RemoveGamingApps,
|
|
|
|
|
[switch]$RemoveCommApps,
|
2025-05-04 12:27:19 -04:00
|
|
|
[switch]$RemoveHPApps,
|
2024-05-20 13:09:08 +02:00
|
|
|
[switch]$RemoveW11Outlook,
|
2024-07-02 18:51:00 +02:00
|
|
|
[switch]$ForceRemoveEdge,
|
2024-05-24 14:13:15 +02:00
|
|
|
[switch]$DisableDVR,
|
2024-05-20 13:09:08 +02:00
|
|
|
[switch]$DisableTelemetry,
|
2025-05-01 22:32:41 +01:00
|
|
|
[switch]$DisableFastStartup,
|
2025-08-19 23:24:28 +05:30
|
|
|
[switch]$DisableModernStandbyNetworking,
|
2024-05-20 13:09:08 +02:00
|
|
|
[switch]$DisableBingSearches, [switch]$DisableBing,
|
2024-12-26 19:06:49 +01:00
|
|
|
[switch]$DisableDesktopSpotlight,
|
2024-05-20 13:09:08 +02:00
|
|
|
[switch]$DisableLockscrTips, [switch]$DisableLockscreenTips,
|
|
|
|
|
[switch]$DisableWindowsSuggestions, [switch]$DisableSuggestions,
|
2025-08-16 01:36:00 +02:00
|
|
|
[switch]$DisableEdgeAds,
|
2025-05-20 21:55:38 +02:00
|
|
|
[switch]$DisableSettings365Ads,
|
2025-05-20 21:56:04 +02:00
|
|
|
[switch]$DisableSettingsHome,
|
2024-05-20 13:09:08 +02:00
|
|
|
[switch]$ShowHiddenFolders,
|
|
|
|
|
[switch]$ShowKnownFileExt,
|
|
|
|
|
[switch]$HideDupliDrive,
|
2025-06-12 21:50:57 +02:00
|
|
|
[switch]$EnableDarkMode,
|
|
|
|
|
[switch]$DisableTransparency,
|
|
|
|
|
[switch]$DisableAnimations,
|
2024-05-20 13:09:08 +02:00
|
|
|
[switch]$TaskbarAlignLeft,
|
2025-09-27 14:34:01 +02:00
|
|
|
[switch]$CombineTaskbarAlways, [switch]$CombineTaskbarWhenFull, [switch]$CombineTaskbarNever,
|
2025-10-06 23:33:04 +02:00
|
|
|
[switch]$CombineMMTaskbarAlways, [switch]$CombineMMTaskbarWhenFull, [switch]$CombineMMTaskbarNever,
|
|
|
|
|
[switch]$MMTaskbarModeAll, [switch]$MMTaskbarModeMainActive, [switch]$MMTaskbarModeActive,
|
2024-05-20 13:09:08 +02:00
|
|
|
[switch]$HideSearchTb, [switch]$ShowSearchIconTb, [switch]$ShowSearchLabelTb, [switch]$ShowSearchBoxTb,
|
|
|
|
|
[switch]$HideTaskview,
|
2025-02-03 21:27:46 +01:00
|
|
|
[switch]$DisableStartRecommended,
|
2025-06-11 22:04:17 +02:00
|
|
|
[switch]$DisableStartPhoneLink,
|
2024-05-20 13:09:08 +02:00
|
|
|
[switch]$DisableCopilot,
|
2024-06-05 09:17:24 +02:00
|
|
|
[switch]$DisableRecall,
|
2025-09-17 23:33:52 +02:00
|
|
|
[switch]$DisableClickToDo,
|
2025-08-01 21:21:38 +02:00
|
|
|
[switch]$DisablePaintAI,
|
|
|
|
|
[switch]$DisableNotepadAI,
|
2025-08-16 01:36:00 +02:00
|
|
|
[switch]$DisableEdgeAI,
|
2025-02-13 21:08:47 +01:00
|
|
|
[switch]$DisableWidgets, [switch]$HideWidgets,
|
|
|
|
|
[switch]$DisableChat, [switch]$HideChat,
|
2025-04-16 12:31:18 +02:00
|
|
|
[switch]$EnableEndTask,
|
2025-07-30 15:30:51 -04:00
|
|
|
[switch]$EnableLastActiveClick,
|
2024-05-20 13:09:08 +02:00
|
|
|
[switch]$ClearStart,
|
2025-05-19 00:01:49 +02:00
|
|
|
[string]$ReplaceStart,
|
2024-06-28 16:54:35 +02:00
|
|
|
[switch]$ClearStartAllUsers,
|
2025-05-19 00:01:49 +02:00
|
|
|
[string]$ReplaceStartAllUsers,
|
2024-05-20 13:09:08 +02:00
|
|
|
[switch]$RevertContextMenu,
|
2025-02-13 21:08:47 +01:00
|
|
|
[switch]$DisableMouseAcceleration,
|
2025-04-16 12:56:37 +02:00
|
|
|
[switch]$DisableStickyKeys,
|
2024-09-04 17:46:41 +02:00
|
|
|
[switch]$HideHome,
|
2024-06-29 16:18:23 +02:00
|
|
|
[switch]$HideGallery,
|
2024-10-27 19:28:43 +01:00
|
|
|
[switch]$ExplorerToHome,
|
|
|
|
|
[switch]$ExplorerToThisPC,
|
|
|
|
|
[switch]$ExplorerToDownloads,
|
|
|
|
|
[switch]$ExplorerToOneDrive,
|
2025-11-07 22:13:53 +01:00
|
|
|
[switch]$NoRestartExplorer,
|
2024-05-20 13:09:08 +02:00
|
|
|
[switch]$DisableOnedrive, [switch]$HideOnedrive,
|
|
|
|
|
[switch]$Disable3dObjects, [switch]$Hide3dObjects,
|
|
|
|
|
[switch]$DisableMusic, [switch]$HideMusic,
|
|
|
|
|
[switch]$DisableIncludeInLibrary, [switch]$HideIncludeInLibrary,
|
|
|
|
|
[switch]$DisableGiveAccessTo, [switch]$HideGiveAccessTo,
|
|
|
|
|
[switch]$DisableShare, [switch]$HideShare
|
|
|
|
|
)
|
|
|
|
|
|
2024-06-26 20:27:25 +02:00
|
|
|
# Show error if current powershell environment does not have LanguageMode set to FullLanguage
|
|
|
|
|
if ($ExecutionContext.SessionState.LanguageMode -ne "FullLanguage") {
|
2025-05-25 20:25:06 +02:00
|
|
|
Write-Host "Error: Win11Debloat is unable to run on your system. PowerShell execution is restricted by security policies" -ForegroundColor Red
|
2024-06-26 20:27:25 +02:00
|
|
|
Write-Output ""
|
|
|
|
|
Write-Output "Press enter to exit..."
|
|
|
|
|
Read-Host | Out-Null
|
|
|
|
|
Exit
|
|
|
|
|
}
|
|
|
|
|
|
2024-05-20 14:13:14 +02:00
|
|
|
Clear-Host
|
|
|
|
|
Write-Output "-------------------------------------------------------------------------------------------"
|
|
|
|
|
Write-Output " Win11Debloat Script - Get"
|
|
|
|
|
Write-Output "-------------------------------------------------------------------------------------------"
|
|
|
|
|
|
2024-06-15 01:01:47 +02:00
|
|
|
Write-Output "> Downloading Win11Debloat..."
|
2024-05-20 13:09:08 +02:00
|
|
|
|
2024-06-15 01:01:47 +02:00
|
|
|
# Download latest version of Win11Debloat from github as zip archive
|
2025-10-06 23:43:19 +02:00
|
|
|
Invoke-RestMethod https://api.github.com/repos/Raphire/Win11Debloat/zipball/2025.10.06 -OutFile "$env:TEMP/win11debloat.zip"
|
2024-06-16 00:09:00 +02:00
|
|
|
|
2024-09-29 12:32:07 +02:00
|
|
|
# Remove old script folder if it exists, except for CustomAppsList and SavedSettings files
|
2025-05-19 20:30:11 +02:00
|
|
|
if (Test-Path "$env:TEMP/Win11Debloat") {
|
2024-06-16 00:09:00 +02:00
|
|
|
Write-Output ""
|
|
|
|
|
Write-Output "> Cleaning up old Win11Debloat folder..."
|
2025-05-19 20:30:11 +02:00
|
|
|
Get-ChildItem -Path "$env:TEMP/Win11Debloat" -Exclude CustomAppsList,SavedSettings,Win11Debloat.log | Remove-Item -Recurse -Force
|
2024-06-16 00:09:00 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Write-Output ""
|
|
|
|
|
Write-Output "> Unpacking..."
|
2024-05-20 13:09:08 +02:00
|
|
|
|
2024-06-15 01:01:47 +02:00
|
|
|
# Unzip archive to Win11Debloat folder
|
2025-06-12 22:05:44 +02:00
|
|
|
Expand-Archive "$env:TEMP/win11debloat.zip" "$env:TEMP/Win11Debloat"
|
2024-05-20 13:09:08 +02:00
|
|
|
|
2024-06-15 01:01:47 +02:00
|
|
|
# Remove archive
|
2025-06-12 22:05:44 +02:00
|
|
|
Remove-Item "$env:TEMP/win11debloat.zip"
|
2024-05-20 13:09:08 +02:00
|
|
|
|
2025-05-19 20:30:11 +02:00
|
|
|
# Move files
|
|
|
|
|
Get-ChildItem -Path "$env:TEMP/Win11Debloat/Raphire-Win11Debloat-*" -Recurse | Move-Item -Destination "$env:TEMP/Win11Debloat"
|
|
|
|
|
|
2024-06-15 01:01:47 +02:00
|
|
|
# Make list of arguments to pass on to the script
|
2025-03-06 00:01:04 +01:00
|
|
|
$arguments = $($PSBoundParameters.GetEnumerator() | ForEach-Object {
|
|
|
|
|
if ($_.Value -eq $true) {
|
|
|
|
|
"-$($_.Key)"
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
"-$($_.Key) ""$($_.Value)"""
|
|
|
|
|
}
|
|
|
|
|
})
|
2024-05-20 14:13:14 +02:00
|
|
|
|
2024-06-15 01:01:47 +02:00
|
|
|
Write-Output ""
|
2024-06-16 00:09:00 +02:00
|
|
|
Write-Output "> Running Win11Debloat..."
|
2024-05-20 13:09:08 +02:00
|
|
|
|
2024-06-15 01:01:47 +02:00
|
|
|
# Run Win11Debloat script with the provided arguments
|
2025-05-19 20:30:11 +02:00
|
|
|
$debloatProcess = Start-Process powershell.exe -PassThru -ArgumentList "-executionpolicy bypass -File $env:TEMP\Win11Debloat\Win11Debloat.ps1 $arguments" -Verb RunAs
|
2024-07-02 18:51:00 +02:00
|
|
|
|
|
|
|
|
# Wait for the process to finish before continuing
|
2024-08-17 00:08:09 +02:00
|
|
|
if ($null -ne $debloatProcess) {
|
2024-07-02 18:51:00 +02:00
|
|
|
$debloatProcess.WaitForExit()
|
|
|
|
|
}
|
2024-05-20 14:13:14 +02:00
|
|
|
|
2024-09-29 12:32:07 +02:00
|
|
|
# Remove all remaining script files, except for CustomAppsList and SavedSettings files
|
2025-05-19 20:30:11 +02:00
|
|
|
if (Test-Path "$env:TEMP/Win11Debloat") {
|
2024-09-29 12:32:07 +02:00
|
|
|
Write-Output ""
|
|
|
|
|
Write-Output "> Cleaning up..."
|
2024-06-15 01:01:47 +02:00
|
|
|
|
2024-09-29 12:32:07 +02:00
|
|
|
# Cleanup, remove Win11Debloat directory
|
2025-05-19 20:30:11 +02:00
|
|
|
Get-ChildItem -Path "$env:TEMP/Win11Debloat" -Exclude CustomAppsList,SavedSettings,Win11Debloat.log | Remove-Item -Recurse -Force
|
2024-09-29 12:32:07 +02:00
|
|
|
}
|
2024-06-16 00:09:00 +02:00
|
|
|
|
|
|
|
|
Write-Output ""
|