2022-10-04 21:10:29 +02:00
# Requires -RunAsAdministrator
2020-11-07 02:57:38 +01:00
[ CmdletBinding ( SupportsShouldProcess ) ]
param
(
[ Parameter ( ValueFromPipeline = $true ) ] [ switch ] $RunDefaults ,
2021-12-15 21:45:48 +01:00
[ Parameter ( ValueFromPipeline = $true ) ] [ switch ] $RunWin11Defaults ,
2020-11-07 02:57:38 +01:00
[ Parameter ( ValueFromPipeline = $true ) ] [ switch ] $RemoveApps ,
2022-08-29 19:26:13 +02:00
[ Parameter ( ValueFromPipeline = $true ) ] [ switch ] $DisableTelemetry ,
2020-11-07 02:57:38 +01:00
[ Parameter ( ValueFromPipeline = $true ) ] [ switch ] $DisableBingSearches ,
2022-09-08 16:38:14 +02:00
[ Parameter ( ValueFromPipeline = $true ) ] [ switch ] $DisableBing ,
2020-11-07 02:57:38 +01:00
[ Parameter ( ValueFromPipeline = $true ) ] [ switch ] $DisableLockscreenTips ,
[ Parameter ( ValueFromPipeline = $true ) ] [ switch ] $DisableWindowsSuggestions ,
2022-08-29 19:26:13 +02:00
[ Parameter ( ValueFromPipeline = $true ) ] [ switch ] $DisableChat ,
[ Parameter ( ValueFromPipeline = $true ) ] [ switch ] $DisableWidgets ,
[ Parameter ( ValueFromPipeline = $true ) ] [ switch ] $DisableOnedrive ,
[ Parameter ( ValueFromPipeline = $true ) ] [ switch ] $Disable3dObjects ,
[ Parameter ( ValueFromPipeline = $true ) ] [ switch ] $DisableMusic ,
2020-11-07 02:57:38 +01:00
[ Parameter ( ValueFromPipeline = $true ) ] [ switch ] $DisableIncludeInLibrary ,
[ Parameter ( ValueFromPipeline = $true ) ] [ switch ] $DisableGiveAccessTo ,
[ Parameter ( ValueFromPipeline = $true ) ] [ switch ] $DisableShare
)
2022-04-09 18:52:16 +02:00
# Removes all apps in the list
2020-11-07 02:57:38 +01:00
function RemoveApps
{
2020-11-04 01:48:42 +01:00
Write-Output " > Removing pre-installed windows 10 apps... "
2020-10-27 23:26:39 +01:00
2020-11-03 00:04:33 +01:00
$apps = @ (
2020-11-02 20:01:00 +01:00
# These apps will be uninstalled by default:
#
2020-11-03 00:02:13 +01:00
# If you wish to KEEP any of the apps below simply add a # character
2020-11-02 20:01:00 +01:00
# in front of the specific app in the list below.
2022-09-07 21:43:03 +02:00
" *AdobeSystemsIncorporated.AdobePhotoshopExpress* "
" *Clipchamp.Clipchamp* "
" *Duolingo-LearnLanguagesforFree* "
" *Facebook* "
" *Flipboard* "
" *HULULLC.HULUPLUS* "
" *Microsoft.3DBuilder* "
" *Microsoft.549981C3F5F10* " #Cortana app
" *Microsoft.Asphalt8Airborne* "
2020-11-02 20:01:00 +01:00
" *Microsoft.BingFinance* "
2022-09-07 21:43:03 +02:00
" *Microsoft.BingNews* "
2020-11-02 20:01:00 +01:00
" *Microsoft.BingSports* "
" *Microsoft.BingTranslator* "
2022-09-07 21:43:03 +02:00
" *Microsoft.BingWeather* "
" *Microsoft.GetHelp* "
" *Microsoft.Getstarted* "
" *Microsoft.Messaging* "
" *Microsoft.Microsoft3DViewer* "
2020-10-27 23:26:39 +01:00
" *Microsoft.MicrosoftOfficeHub* "
2022-09-07 21:43:03 +02:00
" *Microsoft.MicrosoftSolitaireCollection* "
2020-11-02 20:01:00 +01:00
" *Microsoft.MicrosoftStickyNotes* "
2022-09-07 21:43:03 +02:00
" *Microsoft.MixedReality.Portal* "
" *Microsoft.NetworkSpeedTest* "
" *Microsoft.News* "
" *Microsoft.Office.OneNote* "
" *Microsoft.Office.Sway* "
2020-10-27 23:26:39 +01:00
" *Microsoft.OneConnect* "
2022-09-07 21:43:03 +02:00
" *Microsoft.Print3D* "
" *Microsoft.RemoteDesktop* "
" *Microsoft.SkypeApp* "
2023-02-05 22:28:41 +01:00
" *Microsoft.Todos* "
2022-09-07 21:43:03 +02:00
" *Microsoft.WindowsAlarms* "
" *Microsoft.WindowsFeedbackHub* "
" *Microsoft.WindowsMaps* "
2020-11-02 20:01:00 +01:00
" *Microsoft.WindowsSoundRecorder* "
" *Microsoft.ZuneMusic* "
" *Microsoft.ZuneVideo* "
2022-09-07 21:43:03 +02:00
" *PICSART-PHOTOSTUDIO* "
" *PandoraMediaInc* "
" *Royal Revolt* "
" *TWITTER* "
" *Wunderlist* "
2020-10-27 23:26:39 +01:00
" *king.com.BubbleWitch3Saga* "
" *king.com.CandyCrushSaga* "
2022-09-07 21:43:03 +02:00
" *king.com.CandyCrushSodaSaga* "
2020-11-02 20:01:00 +01:00
2020-11-03 00:02:13 +01:00
2020-11-02 20:01:00 +01:00
# These apps will NOT be uninstalled by default:
2020-11-03 00:02:13 +01:00
#
2022-09-07 21:43:03 +02:00
# If you wish to REMOVE any of the apps below simply remove the # character
# in front of the specific app in the list below.
2023-02-05 22:28:41 +01:00
#"*Microsoft.GamingApp*"
2022-09-07 21:43:03 +02:00
#"*Microsoft.MSPaint*" # Paint 3D
2020-11-03 00:02:13 +01:00
#"*Microsoft.People*"
2023-02-05 22:28:41 +01:00
#"*Microsoft.PowerAutomateDesktop*"
2020-11-03 00:02:13 +01:00
#"*Microsoft.ScreenSketch*"
2022-09-07 21:43:03 +02:00
#"*Microsoft.Windows.Photos*"
#"*Microsoft.WindowsCalculator*"
#"*Microsoft.WindowsCamera*"
#"*Microsoft.WindowsStore*" # NOTE: This app cannot be reinstalled!
2020-11-06 17:29:50 +01:00
#"*Microsoft.Xbox.TCUI*"
2020-11-02 20:01:00 +01:00
#"*Microsoft.XboxApp*"
#"*Microsoft.XboxGameOverlay*"
#"*Microsoft.XboxGamingOverlay*"
2020-11-06 17:29:50 +01:00
#"*Microsoft.XboxIdentityProvider*"
#"*Microsoft.XboxSpeechToTextOverlay*" # NOTE: This app may not be able to be reinstalled!
2022-09-07 21:43:03 +02:00
#"*Microsoft.YourPhone*"
#"*microsoft.windowscommunicationsapps*" # Mail & Calendar
2020-10-27 23:26:39 +01:00
)
foreach ( $app in $apps ) {
2020-11-07 02:57:38 +01:00
Write-Output " Attempting to remove $app "
2020-10-27 23:26:39 +01:00
Get-AppxPackage -Name $app -AllUsers | Remove-AppxPackage
2023-02-05 22:28:41 +01:00
Get-AppxProvisionedPackage -Online | Where-Object { $_ . PackageName -like $app } | ForEach-Object { Remove-ProvisionedAppxPackage -Online -AllUsers -PackageName $_ . PackageName }
2020-10-27 23:26:39 +01:00
}
}
2022-04-09 18:52:16 +02:00
# Import & execute regfile
2020-11-07 02:57:38 +01:00
function RegImport
{
param
(
$Message ,
$Path
)
2020-11-04 01:48:42 +01:00
2020-11-07 02:57:38 +01:00
Write-Output $Message
reg import $path
2020-11-04 01:48:42 +01:00
}
2022-04-09 18:52:16 +02:00
# Change mode based on provided parameters or user input
2021-12-15 21:45:48 +01:00
if ( ( -NOT $PSBoundParameters . Count ) -or $RunDefaults -or $RunWin11Defaults -or ( ( $PSBoundParameters . Count -eq 1 ) -and ( $PSBoundParameters . ContainsKey ( 'WhatIf' ) -or $PSBoundParameters . ContainsKey ( 'Confirm' ) -or $PSBoundParameters . ContainsKey ( 'Verbose' ) ) ) )
2020-11-07 02:57:38 +01:00
{
if ( $RunDefaults )
{
$Mode = '1' ;
}
2021-12-15 21:45:48 +01:00
elseif ( $RunWin11Defaults )
{
$Mode = '2' ;
}
2020-11-07 02:57:38 +01:00
else
{
2022-09-08 17:20:53 +02:00
Do {
Clear
Write-Output " ------------------------------------------------------------------------------------------- "
Write-Output " Win10Debloat Script - Setup "
Write-Output " ------------------------------------------------------------------------------------------- "
Write-Output " (1) Run Win10Debloat with the Windows 10 default settings "
Write-Output " (2) Run Win10Debloat with the Windows 11 default settings "
2022-10-02 23:36:00 +02:00
Write-Output " (3) Custom mode: Select which changes you want Win10Debloat to make "
2022-09-08 17:20:53 +02:00
Write-Output " "
Write-Output " (0) Show information about the script "
Write-Output " "
Write-Output " "
$Mode = Read-Host " Please select an option (1/2/3/0) "
2020-11-07 02:57:38 +01:00
2022-09-08 17:20:53 +02:00
if ( $Mode -eq '0' ) {
Clear
Write-Output " ------------------------------------------------------------------------------------------- "
Write-Output " Win10Debloat - Information "
Write-Output " ------------------------------------------------------------------------------------------- "
Write-Output " Win10Debloat is a simple and lightweight powershell script that removes pre-installed "
Write-Output " windows 10/11 bloatware apps, disables telemetry and declutters the experience by disabling "
Write-Output " or removing intrusive interface elements, ads and context menu items. No need to "
Write-Output " painstakingly go through all the settings yourself, or removing apps one by one! "
Write-Output " "
Write-Output " ------------------------------------------------------------------------------------------- "
Write-Output " Windows 10 default settings will: "
Write-Output " ------------------------------------------------------------------------------------------- "
Write-Output " - Remove bloatware apps, full list can be found on github. (github.com/raphire/win10debloat) "
Write-Output " - Disable telemetry, diagnostic data & targeted ads. "
Write-Output " - Disable bing & cortana in windows search. "
Write-Output " - Disable tips & tricks on the lockscreen. (This may change your lockscreen wallpaper to the default) "
Write-Output " - Disable tips, tricks and suggestions in the startmenu and settings, and ads in windows explorer. "
Write-Output " - Hide the Chat (meet now) & Widget (news and interests) icons from the taskbar. "
Write-Output " - Hide the 3D objects folder under 'This pc' in windows explorer. "
Write-Output " - Disable the 'Include in library' from context menu. "
Write-Output " - Disable the 'Give access to' from context menu. "
Write-Output " - Disable the 'Share' from context menu. (Does not remove the onedrive share option) "
Write-Output " "
Write-Output " ------------------------------------------------------------------------------------------- "
Write-Output " Windows 11 default settings will: "
Write-Output " ------------------------------------------------------------------------------------------- "
Write-Output " - Remove bloatware apps, full list can be found on github. (github.com/raphire/win10debloat) "
Write-Output " - Disable telemetry, diagnostic data & targeted ads. "
Write-Output " - Disable bing & cortana in windows search. "
Write-Output " - Disable tips & tricks on the lockscreen. (This may change your lockscreen wallpaper to the default) "
Write-Output " - Disable tips, tricks and suggestions in the startmenu and settings, and ads in windows explorer. "
Write-Output " - Hide the Chat & Widget icons from the taskbar. "
Write-Output " "
Write-Output " "
Write-Output " Press any key to go back... "
$null = $Host . UI . RawUI . ReadKey ( " NoEcho,IncludeKeyDown " )
}
}
while ( $Mode -ne '1' -and $Mode -ne '2' -and $Mode -ne '3' )
2020-11-07 02:57:38 +01:00
}
2020-11-06 12:48:13 +01:00
2022-04-09 18:52:16 +02:00
# Add execution parameters based on the mode
2020-11-07 02:57:38 +01:00
switch ( $Mode )
{
'1'
{
Clear
Write-Output " ------------------------------------------------------------------------------------------- "
2021-12-15 21:45:48 +01:00
Write-Output " Win10Debloat Script - Windows 10 Default Configuration "
2020-11-07 02:57:38 +01:00
Write-Output " ------------------------------------------------------------------------------------------- "
$PSBoundParameters . Add ( 'RemoveApps' , $RemoveApps )
2022-08-29 16:14:36 +02:00
$PSBoundParameters . Add ( 'DisableTelemetry' , $DisableTelemetry )
2022-09-08 16:38:14 +02:00
$PSBoundParameters . Add ( 'DisableBing' , $DisableBing )
2020-11-07 02:57:38 +01:00
$PSBoundParameters . Add ( 'DisableLockscreenTips' , $DisableLockscreenTips )
$PSBoundParameters . Add ( 'DisableWindowsSuggestions' , $DisableWindowsSuggestions )
2022-08-29 19:26:13 +02:00
$PSBoundParameters . Add ( 'DisableChat' , $DisableChat )
$PSBoundParameters . Add ( 'DisableWidgets' , $DisableWidgets )
$PSBoundParameters . Add ( 'Disable3dObjects' , $Disable3dObjects )
2020-11-07 02:57:38 +01:00
$PSBoundParameters . Add ( 'DisableIncludeInLibrary' , $DisableIncludeInLibrary )
$PSBoundParameters . Add ( 'DisableGiveAccessTo' , $DisableGiveAccessTo )
$PSBoundParameters . Add ( 'DisableShare' , $DisableShare )
}
2022-09-08 17:20:53 +02:00
2020-11-07 02:57:38 +01:00
'2'
2021-12-15 21:45:48 +01:00
{
Clear
Write-Output " ------------------------------------------------------------------------------------------- "
Write-Output " Win10Debloat Script - Windows 11 Default Configuration "
Write-Output " ------------------------------------------------------------------------------------------- "
2022-08-28 22:17:32 +02:00
$PSBoundParameters . Add ( 'RemoveApps' , $RemoveApps )
2022-08-29 16:14:36 +02:00
$PSBoundParameters . Add ( 'DisableTelemetry' , $DisableTelemetry )
2022-09-08 16:38:14 +02:00
$PSBoundParameters . Add ( 'DisableBing' , $DisableBing )
2021-12-15 21:45:48 +01:00
$PSBoundParameters . Add ( 'DisableLockscreenTips' , $DisableLockscreenTips )
$PSBoundParameters . Add ( 'DisableWindowsSuggestions' , $DisableWindowsSuggestions )
2022-08-29 19:26:13 +02:00
$PSBoundParameters . Add ( 'DisableChat' , $DisableChat )
$PSBoundParameters . Add ( 'DisableWidgets' , $DisableWidgets )
2021-12-15 21:45:48 +01:00
}
2022-09-08 17:20:53 +02:00
2021-12-15 21:45:48 +01:00
'3'
2020-11-07 02:57:38 +01:00
{
Clear
Write-Output " ------------------------------------------------------------------------------------------- "
2022-10-02 23:36:00 +02:00
Write-Output " Win10Debloat Script - Custom Configuration "
2020-11-07 02:57:38 +01:00
Write-Output " ------------------------------------------------------------------------------------------- "
if ( $ ( Read-Host -Prompt " Remove the pre-installed windows 10 apps? (y/n) " ) -eq 'y' )
{
$PSBoundParameters . Add ( 'RemoveApps' , $RemoveApps )
}
2022-08-29 16:14:36 +02:00
if ( $ ( Read-Host -Prompt " Disable telemetry, diagnostic data and targeted ads? (y/n) " ) -eq 'y' )
2020-11-07 02:57:38 +01:00
{
2022-08-29 16:14:36 +02:00
$PSBoundParameters . Add ( 'DisableTelemetry' , $DisableTelemetry )
2020-11-07 02:57:38 +01:00
}
2022-09-08 16:38:14 +02:00
if ( $ ( Read-Host -Prompt " Disable bing & cortana in windows search? (y/n) " ) -eq 'y' )
2020-11-07 02:57:38 +01:00
{
2022-09-08 16:38:14 +02:00
$PSBoundParameters . Add ( 'DisableBing' , $DisableBing )
2020-11-07 02:57:38 +01:00
}
if ( $ ( Read-Host -Prompt " Disable tips & tricks on the lockscreen? (y/n) " ) -eq 'y' )
{
$PSBoundParameters . Add ( 'DisableLockscreenTips' , $DisableLockscreenTips )
}
2022-08-29 19:26:13 +02:00
if ( $ ( Read-Host -Prompt " Disable tips, tricks and suggestions in the startmenu and settings, and ads in windows explorer? (y/n) " ) -eq 'y' )
2020-11-07 02:57:38 +01:00
{
$PSBoundParameters . Add ( 'DisableWindowsSuggestions' , $DisableWindowsSuggestions )
}
2022-08-29 19:26:13 +02:00
if ( $ ( Read-Host -Prompt " Do you want to hide any icons from the taskbar? (y/n) " ) -eq 'y' )
{
if ( $ ( Read-Host -Prompt " Hide the chat (meet now) icon on the taskbar? (y/n) " ) -eq 'y' )
{
$PSBoundParameters . Add ( 'DisableChat' , $DisableChat )
}
if ( $ ( Read-Host -Prompt " Hide the widget (news and interests) icon on the taskbar? (y/n) " ) -eq 'y' )
{
$PSBoundParameters . Add ( 'DisableWidgets' , $DisableWidgets )
}
}
2022-08-29 16:14:36 +02:00
if ( $ ( Read-Host -Prompt " Do you want to hide any folders from the windows explorer sidepanel? (y/n) " ) -eq 'y' )
2020-11-07 02:57:38 +01:00
{
2022-08-29 16:14:36 +02:00
if ( $ ( Read-Host -Prompt " Hide the onedrive folder in windows explorer? (y/n) " ) -eq 'y' )
{
$PSBoundParameters . Add ( 'DisableOnedrive' , $DisableOnedrive )
}
2020-11-07 02:57:38 +01:00
2022-08-29 16:14:36 +02:00
if ( $ ( Read-Host -Prompt " Hide the 3D objects folder in windows explorer? (y/n) " ) -eq 'y' )
{
$PSBoundParameters . Add ( 'Disable3dObjects' , $Disable3dObjects )
}
if ( $ ( Read-Host -Prompt " Hide the music folder in windows explorer? (y/n) " ) -eq 'y' )
{
$PSBoundParameters . Add ( 'DisableMusic' , $DisableMusic )
}
2020-11-07 02:57:38 +01:00
}
2022-08-29 16:14:36 +02:00
if ( $ ( Read-Host -Prompt " Do you want to disable any context menu options? (y/n) " ) -eq 'y' )
2020-11-07 02:57:38 +01:00
{
2022-08-29 16:14:36 +02:00
if ( $ ( Read-Host -Prompt " Disable the 'Include in library' option in the context menu? (y/n) " ) -eq 'y' )
{
$PSBoundParameters . Add ( 'DisableIncludeInLibrary' , $DisableIncludeInLibrary )
}
if ( $ ( Read-Host -Prompt " Disable the 'Give access to' option in the context menu? (y/n) " ) -eq 'y' )
{
$PSBoundParameters . Add ( 'DisableGiveAccessTo' , $DisableGiveAccessTo )
}
if ( $ ( Read-Host -Prompt " Disable the 'Share' option in the context menu? (y/n) " ) -eq 'y' )
{
$PSBoundParameters . Add ( 'DisableShare' , $DisableShare )
}
2020-11-07 02:57:38 +01:00
}
Write-Output " "
}
}
2020-11-06 12:48:13 +01:00
}
2020-11-07 02:57:38 +01:00
else
{
Clear
Write-Output " ------------------------------------------------------------------------------------------- "
Write-Output " Win10Debloat Script - Custom Configuration "
Write-Output " ------------------------------------------------------------------------------------------- "
2020-11-06 12:48:13 +01:00
}
2022-04-09 18:52:16 +02:00
# Execute all selected/provided parameters
2020-11-07 02:57:38 +01:00
switch ( $PSBoundParameters . Keys )
{
'RemoveApps'
{
RemoveApps
}
2022-08-29 16:14:36 +02:00
'DisableTelemetry'
2020-11-07 02:57:38 +01:00
{
2022-08-29 16:14:36 +02:00
RegImport " > Disabling telemetry, diagnostic data and targeted ads... " $PSScriptRoot \ Regfiles \ Disable_Telemetry . reg
2020-11-07 02:57:38 +01:00
}
'DisableBingSearches'
{
2022-09-08 16:38:14 +02:00
RegImport " > Disabling bing & cortana in windows search... " $PSScriptRoot \ Regfiles \ Disable_Bing_Cortana_In_Search . reg
}
'DisableBing'
{
RegImport " > Disabling bing & cortana in windows search... " $PSScriptRoot \ Regfiles \ Disable_Bing_Cortana_In_Search . reg
2020-11-07 02:57:38 +01:00
}
'DisableLockscreenTips'
{
RegImport " > Disabling tips & tricks on the lockscreen... " $PSScriptRoot \ Regfiles \ Disable_Lockscreen_Tips . reg
}
'DisableWindowsSuggestions'
{
2022-08-29 19:26:13 +02:00
RegImport " > Disabling tips, tricks and suggestions in the startmenu and settings, and ads in windows explorer... " $PSScriptRoot \ Regfiles \ Disable_Windows_Suggestions . reg
}
'DisableChat'
{
RegImport " > Hiding the chat icon on the taskbar... " $PSScriptRoot \ Regfiles \ Disable_Chat_Taskbar . reg
2020-11-07 02:57:38 +01:00
}
2022-08-29 19:26:13 +02:00
'DisableWidgets'
2022-08-29 16:14:36 +02:00
{
2022-08-29 19:26:13 +02:00
RegImport " > Hiding the widget icon on the taskbar... " $PSScriptRoot \ Regfiles \ Disable_Widgets_Taskbar . reg
2022-08-29 16:14:36 +02:00
}
'DisableOnedrive'
{
RegImport " > Hiding the onedrive folder in windows explorer... " $PSScriptRoot \ Regfiles \ Hide_Onedrive_Folder . reg
}
'Disable3dObjects'
{
RegImport " > Hiding the 3D objects folder in windows explorer... " $PSScriptRoot \ Regfiles \ Hide_3D_Objects_Folder . reg
}
'DisableMusic'
{
RegImport " > Hiding the music folder in windows explorer... " $PSScriptRoot \ Regfiles \ Hide_Music_folder . reg
}
2020-11-07 02:57:38 +01:00
'DisableIncludeInLibrary'
{
RegImport " > Disabling 'Include in library' in the context menu... " $PSScriptRoot \ Regfiles \ Disable_Include_in_library_from_context_menu . reg
}
'DisableGiveAccessTo'
{
RegImport " > Disabling 'Give access to' in the context menu... " $PSScriptRoot \ Regfiles \ Disable_Give_access_to_context_menu . reg
}
'DisableShare'
{
RegImport " > Disabling 'Share' in the context menu... " $PSScriptRoot \ Regfiles \ Disable_Share_from_context_menu . reg
}
2020-10-27 23:26:39 +01:00
}
Write-Output " "
2020-11-03 21:24:02 +01:00
Write-Output " Script completed! Please restart your PC to make sure all changes are properly applied. "
Write-Output " "
2022-09-08 17:20:53 +02:00
Write-Output " "
2020-10-28 15:53:43 +01:00
Write-Output " Press any key to continue... "
2022-09-08 17:20:53 +02:00
$null = $Host . UI . RawUI . ReadKey ( " NoEcho,IncludeKeyDown " )