##Elevate if needed If (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]'Administrator')) { Write-Host "You didn't run this script as an Administrator. This script will self elevate to run as an Administrator and continue." Start-Sleep 1 Write-Host " 3" Start-Sleep 1 Write-Host " 2" Start-Sleep 1 Write-Host " 1" Start-Sleep 1 Start-Process powershell.exe -ArgumentList ("-NoProfile -ExecutionPolicy Bypass -File `"{0}`"" -f $PSCommandPath) -Verb RunAs Exit } #no errors throughout $ErrorActionPreference = 'silentlycontinue' #Create Folder $DebloatFolder = "C:\Temp\WindowsDebloater" If (Test-Path $DebloatFolder) { Write-Output "$DebloatFolder exists. Skipping." } Else { Write-Output "The folder '$DebloatFolder' doesn't exist. This folder will be used for storing logs created after the script runs. Creating now." Start-Sleep 1 New-Item -Path "$DebloatFolder" -ItemType Directory Write-Output "The folder $DebloatFolder was successfully created." } #Removes AppxPackages #Credit to /u/GavinEke for a modified version of my whitelist code $WhitelistedApps = 'Microsoft.ScreenSketch|Microsoft.Paint3D|Microsoft.WindowsCalculator|Microsoft.WindowsStore|Microsoft.Windows.Photos|CanonicalGroupLimited.UbuntuonWindows|` |Microsoft.MicrosoftStickyNotes|Microsoft.MSPaint|Microsoft.WindowsCamera|.NET|Framework|` Microsoft.HEIFImageExtension|Microsoft.ScreenSketch|Microsoft.StorePurchaseApp|Microsoft.VP9VideoExtensions|Microsoft.WebMediaExtensions|Microsoft.WebpImageExtension|Microsoft.DesktopAppInstaller|WindSynthBerry|MIDIBerry|Slack' #NonRemovable Apps that where getting attempted and the system would reject the uninstall, speeds up debloat and prevents 'initalizing' overlay when removing apps $NonRemovable = '1527c705-839a-4832-9118-54d4Bd6a0c89|c5e2524a-ea46-4f67-841f-6a9465d9d515|E2A4F912-2574-4A75-9BB0-0D023378592B|F46D4000-FD22-4DB4-AC8E-4E1DDDE828FE|InputApp|Microsoft.AAD.BrokerPlugin|Microsoft.AccountsControl|` Microsoft.BioEnrollment|Microsoft.CredDialogHost|Microsoft.ECApp|Microsoft.LockApp|Microsoft.MicrosoftEdgeDevToolsClient|Microsoft.MicrosoftEdge|Microsoft.PPIProjection|Microsoft.Win32WebViewHost|Microsoft.Windows.Apprep.ChxApp|` Microsoft.Windows.AssignedAccessLockApp|Microsoft.Windows.CapturePicker|Microsoft.Windows.CloudExperienceHost|Microsoft.Windows.ContentDeliveryManager|Microsoft.Windows.Cortana|Microsoft.Windows.NarratorQuickStart|` Microsoft.Windows.ParentalControls|Microsoft.Windows.PeopleExperienceHost|Microsoft.Windows.PinningConfirmationDialog|Microsoft.Windows.SecHealthUI|Microsoft.Windows.SecureAssessmentBrowser|Microsoft.Windows.ShellExperienceHost|` Microsoft.Windows.XGpuEjectDialog|Microsoft.XboxGameCallableUI|Windows.CBSPreview|windows.immersivecontrolpanel|Windows.PrintDialog|Microsoft.VCLibs.140.00|Microsoft.Services.Store.Engagement|Microsoft.UI.Xaml.2.0|*Nvidia*' Get-AppxPackage -AllUsers | Where-Object {$_.Name -NotMatch $WhitelistedApps -and $_.Name -NotMatch $NonRemovable} | Remove-AppxPackage Get-AppxPackage | Where-Object {$_.Name -NotMatch $WhitelistedApps -and $_.Name -NotMatch $NonRemovable} | Remove-AppxPackage Get-AppxProvisionedPackage -Online | Where-Object {$_.PackageName -NotMatch $WhitelistedApps -and $_.PackageName -NotMatch $NonRemovable} | Remove-AppxProvisionedPackage -Online ##Remove bloat $Bloatware = @( #Unnecessary Windows 10/11 AppX Apps "Microsoft.BingNews" "Microsoft.GetHelp" "Microsoft.Getstarted" "Microsoft.Messaging" "Microsoft.Microsoft3DViewer" "Microsoft.MicrosoftOfficeHub" "Microsoft.MicrosoftSolitaireCollection" "Microsoft.NetworkSpeedTest" "Microsoft.News" "Microsoft.Office.Lens" "Microsoft.Office.OneNote" "Microsoft.Office.Sway" "Microsoft.OneConnect" "Microsoft.People" "Microsoft.Print3D" "Microsoft.RemoteDesktop" "Microsoft.SkypeApp" "Microsoft.StorePurchaseApp" "Microsoft.Office.Todo.List" "Microsoft.Whiteboard" "Microsoft.WindowsAlarms" #"Microsoft.WindowsCamera" "microsoft.windowscommunicationsapps" "Microsoft.WindowsFeedbackHub" "Microsoft.WindowsMaps" "Microsoft.WindowsSoundRecorder" "Microsoft.Xbox.TCUI" "Microsoft.XboxApp" "Microsoft.XboxGameOverlay" "Microsoft.XboxIdentityProvider" "Microsoft.XboxSpeechToTextOverlay" "Microsoft.ZuneMusic" "Microsoft.ZuneVideo" "MicrosoftTeams" "Microsoft.YourPhone" "Microsoft.XboxGamingOverlay_5.721.10202.0_neutral_~_8wekyb3d8bbwe" "Microsoft.GamingApp" #Sponsored Windows 10 AppX Apps #Add sponsored/featured apps to remove in the "*AppName*" format "*EclipseManager*" "*ActiproSoftwareLLC*" "*AdobeSystemsIncorporated.AdobePhotoshopExpress*" "*Duolingo-LearnLanguagesforFree*" "*PandoraMediaInc*" "*CandyCrush*" "*BubbleWitch3Saga*" "*Wunderlist*" "*Flipboard*" "*Twitter*" "*Facebook*" "*Spotify*" "*Minecraft*" "*Royal Revolt*" "*Sway*" "*Speed Test*" "*Dolby*" #Optional: Typically not removed but you can if you need to for some reason #"*Microsoft.Advertising.Xaml_10.1712.5.0_x64__8wekyb3d8bbwe*" #"*Microsoft.Advertising.Xaml_10.1712.5.0_x86__8wekyb3d8bbwe*" #"*Microsoft.BingWeather*" #"*Microsoft.MSPaint*" #"*Microsoft.MicrosoftStickyNotes*" #"*Microsoft.Windows.Photos*" #"*Microsoft.WindowsCalculator*" #"*Microsoft.WindowsStore*" ) foreach ($Bloat in $Bloatware) { Get-AppxPackage -Name $Bloat| Remove-AppxPackage Get-AppxProvisionedPackage -Online | Where-Object DisplayName -like $Bloat | Remove-AppxProvisionedPackage -Online Write-Output "Trying to remove $Bloat." } #These are the registry keys that it will delete. $Keys = @( #Remove Background Tasks "HKCR:\Extensions\ContractId\Windows.BackgroundTasks\PackageId\46928bounde.EclipseManager_2.2.4.51_neutral__a5h4egax66k6y" "HKCR:\Extensions\ContractId\Windows.BackgroundTasks\PackageId\ActiproSoftwareLLC.562882FEEB491_2.6.18.18_neutral__24pqs290vpjk0" "HKCR:\Extensions\ContractId\Windows.BackgroundTasks\PackageId\Microsoft.MicrosoftOfficeHub_17.7909.7600.0_x64__8wekyb3d8bbwe" "HKCR:\Extensions\ContractId\Windows.BackgroundTasks\PackageId\Microsoft.PPIProjection_10.0.15063.0_neutral_neutral_cw5n1h2txyewy" "HKCR:\Extensions\ContractId\Windows.BackgroundTasks\PackageId\Microsoft.XboxGameCallableUI_1000.15063.0.0_neutral_neutral_cw5n1h2txyewy" "HKCR:\Extensions\ContractId\Windows.BackgroundTasks\PackageId\Microsoft.XboxGameCallableUI_1000.16299.15.0_neutral_neutral_cw5n1h2txyewy" #Windows File "HKCR:\Extensions\ContractId\Windows.File\PackageId\ActiproSoftwareLLC.562882FEEB491_2.6.18.18_neutral__24pqs290vpjk0" #Registry keys to delete if they aren't uninstalled by RemoveAppXPackage/RemoveAppXProvisionedPackage "HKCR:\Extensions\ContractId\Windows.Launch\PackageId\46928bounde.EclipseManager_2.2.4.51_neutral__a5h4egax66k6y" "HKCR:\Extensions\ContractId\Windows.Launch\PackageId\ActiproSoftwareLLC.562882FEEB491_2.6.18.18_neutral__24pqs290vpjk0" "HKCR:\Extensions\ContractId\Windows.Launch\PackageId\Microsoft.PPIProjection_10.0.15063.0_neutral_neutral_cw5n1h2txyewy" "HKCR:\Extensions\ContractId\Windows.Launch\PackageId\Microsoft.XboxGameCallableUI_1000.15063.0.0_neutral_neutral_cw5n1h2txyewy" "HKCR:\Extensions\ContractId\Windows.Launch\PackageId\Microsoft.XboxGameCallableUI_1000.16299.15.0_neutral_neutral_cw5n1h2txyewy" #Scheduled Tasks to delete "HKCR:\Extensions\ContractId\Windows.PreInstalledConfigTask\PackageId\Microsoft.MicrosoftOfficeHub_17.7909.7600.0_x64__8wekyb3d8bbwe" #Windows Protocol Keys "HKCR:\Extensions\ContractId\Windows.Protocol\PackageId\ActiproSoftwareLLC.562882FEEB491_2.6.18.18_neutral__24pqs290vpjk0" "HKCR:\Extensions\ContractId\Windows.Protocol\PackageId\Microsoft.PPIProjection_10.0.15063.0_neutral_neutral_cw5n1h2txyewy" "HKCR:\Extensions\ContractId\Windows.Protocol\PackageId\Microsoft.XboxGameCallableUI_1000.15063.0.0_neutral_neutral_cw5n1h2txyewy" "HKCR:\Extensions\ContractId\Windows.Protocol\PackageId\Microsoft.XboxGameCallableUI_1000.16299.15.0_neutral_neutral_cw5n1h2txyewy" #Windows Share Target "HKCR:\Extensions\ContractId\Windows.ShareTarget\PackageId\ActiproSoftwareLLC.562882FEEB491_2.6.18.18_neutral__24pqs290vpjk0" ) #This writes the output of each key it is removing and also removes the keys listed above. ForEach ($Key in $Keys) { Write-Output "Removing $Key from registry" Remove-Item $Key -Recurse } #Disables Windows Feedback Experience Write-Output "Disabling Windows Feedback Experience program" $Advertising = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo" If (Test-Path $Advertising) { Set-ItemProperty $Advertising Enabled -Value 0 } #Stops Cortana from being used as part of your Windows Search Function Write-Output "Stopping Cortana from being used as part of your Windows Search Function" $Search = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" If (Test-Path $Search) { Set-ItemProperty $Search AllowCortana -Value 0 } #Disables Web Search in Start Menu Write-Output "Disabling Bing Search in Start Menu" $WebSearch = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" BingSearchEnabled -Value 0 If (!(Test-Path $WebSearch)) { New-Item $WebSearch } Set-ItemProperty $WebSearch DisableWebSearch -Value 1 #Stops the Windows Feedback Experience from sending anonymous data Write-Output "Stopping the Windows Feedback Experience program" $Period = "HKCU:\Software\Microsoft\Siuf\Rules" If (!(Test-Path $Period)) { New-Item $Period } Set-ItemProperty $Period PeriodInNanoSeconds -Value 0 #Prevents bloatware applications from returning and removes Start Menu suggestions Write-Output "Adding Registry key to prevent bloatware apps from returning" $registryPath = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" $registryOEM = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" If (!(Test-Path $registryPath)) { New-Item $registryPath } Set-ItemProperty $registryPath DisableWindowsConsumerFeatures -Value 1 If (!(Test-Path $registryOEM)) { New-Item $registryOEM } Set-ItemProperty $registryOEM ContentDeliveryAllowed -Value 0 Set-ItemProperty $registryOEM OemPreInstalledAppsEnabled -Value 0 Set-ItemProperty $registryOEM PreInstalledAppsEnabled -Value 0 Set-ItemProperty $registryOEM PreInstalledAppsEverEnabled -Value 0 Set-ItemProperty $registryOEM SilentInstalledAppsEnabled -Value 0 Set-ItemProperty $registryOEM SystemPaneSuggestionsEnabled -Value 0 #Preping mixed Reality Portal for removal Write-Output "Setting Mixed Reality Portal value to 0 so that you can uninstall it in Settings" $Holo = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Holographic" If (Test-Path $Holo) { Set-ItemProperty $Holo FirstRunSucceeded -Value 0 } #Disables Wi-fi Sense Write-Output "Disabling Wi-Fi Sense" $WifiSense1 = "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting" $WifiSense2 = "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\WiFi\AllowAutoConnectToWiFiSenseHotspots" $WifiSense3 = "HKLM:\SOFTWARE\Microsoft\WcmSvc\wifinetworkmanager\config" If (!(Test-Path $WifiSense1)) { New-Item $WifiSense1 } Set-ItemProperty $WifiSense1 Value -Value 0 If (!(Test-Path $WifiSense2)) { New-Item $WifiSense2 } Set-ItemProperty $WifiSense2 Value -Value 0 Set-ItemProperty $WifiSense3 AutoConnectAllowedOEM -Value 0 #Disables live tiles Write-Output "Disabling live tiles" $Live = "HKCU:\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\PushNotifications" If (!(Test-Path $Live)) { New-Item $Live } Set-ItemProperty $Live NoTileApplicationNotification -Value 1 #Turns off Data Collection via the AllowTelemtry key by changing it to 0 Write-Output "Turning off Data Collection" $DataCollection1 = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection" $DataCollection2 = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection" $DataCollection3 = "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Policies\DataCollection" If (Test-Path $DataCollection1) { Set-ItemProperty $DataCollection1 AllowTelemetry -Value 0 } If (Test-Path $DataCollection2) { Set-ItemProperty $DataCollection2 AllowTelemetry -Value 0 } If (Test-Path $DataCollection3) { Set-ItemProperty $DataCollection3 AllowTelemetry -Value 0 } #Disabling Location Tracking Write-Output "Disabling Location Tracking" $SensorState = "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Sensor\Overrides\{BFA794E4-F964-4FDB-90F6-51056BFE4B44}" $LocationConfig = "HKLM:\SYSTEM\CurrentControlSet\Services\lfsvc\Service\Configuration" If (!(Test-Path $SensorState)) { New-Item $SensorState } Set-ItemProperty $SensorState SensorPermissionState -Value 0 If (!(Test-Path $LocationConfig)) { New-Item $LocationConfig } Set-ItemProperty $LocationConfig Status -Value 0 #Disables People icon on Taskbar Write-Output "Disabling People icon on Taskbar" $People = 'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People' If (Test-Path $People) { Set-ItemProperty $People -Name PeopleBand -Value 0 } #Disables scheduled tasks that are considered unnecessary Write-Output "Disabling scheduled tasks" Get-ScheduledTask XblGameSaveTaskLogon | Disable-ScheduledTask Get-ScheduledTask XblGameSaveTask | Disable-ScheduledTask Get-ScheduledTask Consolidator | Disable-ScheduledTask Get-ScheduledTask UsbCeip | Disable-ScheduledTask Get-ScheduledTask DmClient | Disable-ScheduledTask Get-ScheduledTask DmClientOnScenarioDownload | Disable-ScheduledTask Write-Output "Stopping and disabling Diagnostics Tracking Service" #Disabling the Diagnostics Tracking Service Stop-Service "DiagTrack" Set-Service "DiagTrack" -StartupType Disabled Write-Output "Removing CloudStore from registry if it exists" $CloudStore = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\CloudStore' If (Test-Path $CloudStore) { Stop-Process Explorer.exe -Force Remove-Item $CloudStore -Recurse -Force Start-Process Explorer.exe -Wait } Write-Host "Disabling Cortana" $Cortana1 = "HKCU:\SOFTWARE\Microsoft\Personalization\Settings" $Cortana2 = "HKCU:\SOFTWARE\Microsoft\InputPersonalization" $Cortana3 = "HKCU:\SOFTWARE\Microsoft\InputPersonalization\TrainedDataStore" If (!(Test-Path $Cortana1)) { New-Item $Cortana1 } Set-ItemProperty $Cortana1 AcceptedPrivacyPolicy -Value 0 If (!(Test-Path $Cortana2)) { New-Item $Cortana2 } Set-ItemProperty $Cortana2 RestrictImplicitTextCollection -Value 1 Set-ItemProperty $Cortana2 RestrictImplicitInkCollection -Value 1 If (!(Test-Path $Cortana3)) { New-Item $Cortana3 } Set-ItemProperty $Cortana3 HarvestContacts -Value 0 #Removes 3D Objects from the 'My Computer' submenu in explorer Write-Host "Removing 3D Objects from explorer 'My Computer' submenu" $Objects32 = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{0DB7E03F-FC29-4DC6-9020-FF41B59E513A}" $Objects64 = "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{0DB7E03F-FC29-4DC6-9020-FF41B59E513A}" If (Test-Path $Objects32) { Remove-Item $Objects32 -Recurse } If (Test-Path $Objects64) { Remove-Item $Objects64 -Recurse } #Windows 11 Customisations #Remove XBox Game Bar Get-AppxPackage Microsoft.XboxGamingOverlay | Remove-AppxPackage Get-AppxPackage Microsoft.XboxGameCallableUI | Remove-AppxPackage #Remove Cortana Get-AppxPackage -allusers Microsoft.549981C3F5F10 | Remove-AppxPackage #Remove GetStarted Get-AppxPackage *getstarted* | Remove-AppxPackage #Remove Parental Controls Get-AppxPackage Microsoft.Windows.ParentalControls | Remove-AppxPackage #Remove Teams 'Chat' $MSTeams = "MicrosoftTeams" $WinPackage = Get-AppxPackage | Where-Object {$_.Name -eq $MSTeams} $ProvisionedPackage = Get-AppxProvisionedPackage -Online | Where-Object { $_.DisplayName -eq $WinPackage } If ($null -ne $WinPackage) { Remove-AppxPackage -Package $WinPackage.PackageFullName } If ($null -ne $ProvisionedPackage) { Remove-AppxProvisionedPackage -online -Packagename $ProvisionedPackage.Packagename } $WinPackageCheck = Get-AppxPackage | Where-Object {$_.Name -eq $MSTeams} $ProvisionedPackageCheck = Get-AppxProvisionedPackage -Online | Where-Object { $_.DisplayName -eq $WinPackage } If (($WinPackageCheck) -or ($ProvisionedPackageCheck)) { throw }