2022-10-04 21:10:29 +02:00
# Requires -RunAsAdministrator
2020-11-07 02:57:38 +01:00
[ CmdletBinding ( SupportsShouldProcess ) ]
param
(
2023-05-15 16:38:11 -06:00
[ Parameter ( ValueFromPipeline = $true ) ] [ switch ] $RunDefaults ,
[ Parameter ( ValueFromPipeline = $true ) ] [ switch ] $RunWin11Defaults ,
[ Parameter ( ValueFromPipeline = $true ) ] [ switch ] $RemoveApps ,
[ Parameter ( ValueFromPipeline = $true ) ] [ switch ] $DisableTelemetry ,
[ Parameter ( ValueFromPipeline = $true ) ] [ switch ] $DisableBingSearches ,
[ Parameter ( ValueFromPipeline = $true ) ] [ switch ] $DisableBing ,
[ Parameter ( ValueFromPipeline = $true ) ] [ switch ] $DisableLockscreenTips ,
[ Parameter ( ValueFromPipeline = $true ) ] [ switch ] $DisableWindowsSuggestions ,
[ Parameter ( ValueFromPipeline = $true ) ] [ switch ] $DisableSuggestions ,
[ Parameter ( ValueFromPipeline = $true ) ] [ switch ] $DisableWidgets ,
2023-07-27 01:09:58 +02:00
[ Parameter ( ValueFromPipeline = $true ) ] [ switch ] $HideWidgets ,
2023-07-18 00:14:06 +02:00
[ Parameter ( ValueFromPipeline = $true ) ] [ switch ] $DisableChat ,
2023-07-27 01:09:58 +02:00
[ Parameter ( ValueFromPipeline = $true ) ] [ switch ] $HideChat ,
2023-07-18 00:14:06 +02:00
[ Parameter ( ValueFromPipeline = $true ) ] [ switch ] $TaskbarAlignLeft ,
2023-05-15 16:38:11 -06:00
[ Parameter ( ValueFromPipeline = $true ) ] [ switch ] $DisableOnedrive ,
2023-07-27 01:09:58 +02:00
[ Parameter ( ValueFromPipeline = $true ) ] [ switch ] $HideOnedrive ,
2023-05-15 16:38:11 -06:00
[ Parameter ( ValueFromPipeline = $true ) ] [ switch ] $Disable3dObjects ,
2023-07-27 01:09:58 +02:00
[ Parameter ( ValueFromPipeline = $true ) ] [ switch ] $Hide3dObjects ,
2023-05-15 16:38:11 -06:00
[ Parameter ( ValueFromPipeline = $true ) ] [ switch ] $DisableMusic ,
2023-07-27 01:09:58 +02:00
[ Parameter ( ValueFromPipeline = $true ) ] [ switch ] $HideMusic ,
2023-05-15 16:38:11 -06:00
[ Parameter ( ValueFromPipeline = $true ) ] [ switch ] $DisableIncludeInLibrary ,
2023-07-27 01:09:58 +02:00
[ Parameter ( ValueFromPipeline = $true ) ] [ switch ] $HideIncludeInLibrary ,
2023-05-15 16:38:11 -06:00
[ Parameter ( ValueFromPipeline = $true ) ] [ switch ] $DisableGiveAccessTo ,
2023-07-27 01:09:58 +02:00
[ Parameter ( ValueFromPipeline = $true ) ] [ switch ] $HideGiveAccessTo ,
[ Parameter ( ValueFromPipeline = $true ) ] [ switch ] $DisableShare ,
[ Parameter ( ValueFromPipeline = $true ) ] [ switch ] $HideShare
2020-11-07 02:57:38 +01:00
)
2022-04-09 18:52:16 +02:00
# Removes all apps in the list
2023-05-15 16:38:11 -06:00
function RemoveApps {
2023-06-01 11:49:16 +02:00
Write-Output " > Removing pre-installed windows 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
" *Microsoft.3DBuilder* "
" *Microsoft.549981C3F5F10* " #Cortana app
" *Microsoft.Asphalt8Airborne* "
2020-11-02 20:01:00 +01:00
" *Microsoft.BingFinance* "
2023-07-18 16:03:22 +02:00
" *Microsoft.BingFoodAndDrink* "
" *Microsoft.BingHealthAndFitness* "
2022-09-07 21:43:03 +02:00
" *Microsoft.BingNews* "
2020-11-02 20:01:00 +01:00
" *Microsoft.BingSports* "
" *Microsoft.BingTranslator* "
2023-07-18 16:03:22 +02:00
" *Microsoft.BingTravel* "
2022-09-07 21:43:03 +02:00
" *Microsoft.BingWeather* "
" *Microsoft.GetHelp* "
2023-02-06 21:19:43 +01:00
" *Microsoft.Getstarted* " # Cannot be uninstalled in Windows 11
2022-09-07 21:43:03 +02:00
" *Microsoft.Messaging* "
" *Microsoft.Microsoft3DViewer* "
2020-10-27 23:26:39 +01:00
" *Microsoft.MicrosoftOfficeHub* "
2023-07-18 16:03:22 +02:00
" *Microsoft.MicrosoftPowerBIForWindows* "
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.ZuneVideo* "
2023-07-18 16:03:22 +02:00
" *MicrosoftTeams* "
" *ACGMediaPlayer* "
" *ActiproSoftwareLLC* "
" *AdobeSystemsIncorporated.AdobePhotoshopExpress* "
" *Amazon.com.Amazon* "
" *Asphalt8Airborne* "
" *AutodeskSketchBook* "
" *CaesarsSlotsFreeCasino* "
" *Clipchamp.Clipchamp* "
" *COOKINGFEVER* "
" *CyberLinkMediaSuiteEssentials* "
" *DisneyMagicKingdoms* "
" *Dolby* "
" *DrawboardPDF* "
" *Duolingo-LearnLanguagesforFree* "
" *EclipseManager* "
" *Facebook* "
" *FarmVille2CountryEscape* "
" *fitbit* "
" *Flipboard* "
" *HiddenCity* "
" *HULULLC.HULUPLUS* "
" *iHeartRadio* "
" *king.com.BubbleWitch3Saga* "
" *king.com.CandyCrushSaga* "
" *king.com.CandyCrushSodaSaga* "
" *LinkedInforWindows* "
" *MarchofEmpires* "
" *Netflix* "
" *NYTCrossword* "
" *OneCalendar* "
2022-09-07 21:43:03 +02:00
" *PandoraMediaInc* "
2023-07-18 16:03:22 +02:00
" *PhototasticCollage* "
" *PicsArt-PhotoStudio* "
" *Plex* "
" *PolarrPhotoEditorAcademicEdition* "
2022-09-07 21:43:03 +02:00
" *Royal Revolt* "
2023-07-18 16:03:22 +02:00
" *Shazam* "
" *Sidia.LiveWallpaper* "
" *SlingTV* "
2023-02-06 21:19:43 +01:00
" *Speed Test* "
" *Spotify* "
2023-07-18 16:03:22 +02:00
" *TuneInRadio* "
2023-02-06 21:19:43 +01:00
" *Twitter* "
2023-07-18 16:03:22 +02:00
" *Viber* "
" *WinZipUniversal* "
2022-09-07 21:43:03 +02:00
" *Wunderlist* "
2023-07-18 16:03:22 +02:00
" *XING* "
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-07-20 14:42:52 +02:00
#"*Microsoft.GamingApp*" # Modern Xbox Gaming App, required for installing some PC games
#"*Microsoft.MSPaint*" # Paint 3D
#"*Microsoft.People*" # Required with Mail & Calendar
2023-02-05 22:28:41 +01:00
#"*Microsoft.PowerAutomateDesktop*"
2023-07-20 14:42:52 +02:00
#"*Microsoft.ScreenSketch*" # Snipping Tool
#"*Microsoft.Whiteboard*" # Only preinstalled on devices with touchscreen and/or pen support
2022-09-07 21:43:03 +02:00
#"*Microsoft.Windows.Photos*"
#"*Microsoft.WindowsCalculator*"
#"*Microsoft.WindowsCamera*"
2023-07-20 14:42:52 +02:00
#"*Microsoft.windowscommunicationsapps*" # Mail & Calendar
#"*Microsoft.WindowsStore*" # Microsoft Store, WARNING: This app cannot be reinstalled!
2020-11-06 17:29:50 +01:00
#"*Microsoft.Xbox.TCUI*"
2023-07-20 14:42:52 +02:00
#"*Microsoft.XboxApp*" # Old Xbox Console Companion App, no longer preinstalled
2020-11-02 20:01:00 +01:00
#"*Microsoft.XboxGameOverlay*"
#"*Microsoft.XboxGamingOverlay*"
2020-11-06 17:29:50 +01:00
#"*Microsoft.XboxIdentityProvider*"
2023-07-20 14:42:52 +02:00
#"*Microsoft.XboxSpeechToTextOverlay*" # WARNING: This app cannot be reinstalled!
#"*Microsoft.YourPhone*" # Phone link
#"*Microsoft.ZuneMusic*" # Modern Media Player
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
2023-05-15 16:38:11 -06: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
2023-05-15 16:38:11 -06:00
function RegImport {
2020-11-07 02:57:38 +01:00
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
2023-05-15 16:38:11 -06: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' ) ) ) ) {
if ( $RunDefaults ) {
2020-11-07 02:57:38 +01:00
$Mode = '1' ;
}
2023-05-15 16:38:11 -06:00
elseif ( $RunWin11Defaults ) {
2021-12-15 21:45:48 +01:00
$Mode = '2' ;
}
2023-05-15 16:38:11 -06:00
else {
2022-09-08 17:20:53 +02:00
Do {
2023-05-15 16:38:11 -06:00
Clear-Host
2022-09-08 17:20:53 +02:00
Write-Output " ------------------------------------------------------------------------------------------- "
2023-07-26 23:54:02 +02:00
Write-Output " Win11Debloat Script - Setup "
2022-09-08 17:20:53 +02:00
Write-Output " ------------------------------------------------------------------------------------------- "
2023-07-26 23:54:02 +02:00
Write-Output " (1) Run Win11Debloat with the Windows 10 default settings "
Write-Output " (2) Run Win11Debloat with the Windows 11 default settings "
Write-Output " (3) Custom mode: Select which changes you want Win11Debloat 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
2023-05-15 16:38:11 -06:00
if ( $Mode -eq '0' ) {
Clear-Host
2022-09-08 17:20:53 +02:00
Write-Output " ------------------------------------------------------------------------------------------- "
2023-07-26 23:54:02 +02:00
Write-Output " Win11Debloat - Information "
2022-09-08 17:20:53 +02:00
Write-Output " ------------------------------------------------------------------------------------------- "
2023-07-26 23:54:02 +02:00
Write-Output " Win11Debloat is a simple and lightweight powershell script that removes pre-installed "
Write-Output " windows bloatware apps, disables telemetry and declutters the experience by disabling "
2022-09-08 17:20:53 +02:00
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 " ------------------------------------------------------------------------------------------- "
2023-07-26 23:54:02 +02:00
Write-Output " - Remove bloatware apps, full list can be found on github. (github.com/raphire/win11debloat) "
2022-09-08 17:20:53 +02:00
Write-Output " - Disable telemetry, diagnostic data & targeted ads. "
2023-06-01 11:49:16 +02:00
Write-Output " - Disable bing search & cortana in windows search. "
2022-09-08 17:20:53 +02:00
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. "
2023-07-18 00:14:06 +02:00
Write-Output " - Disable the widget service & hide the widget (news and interests) icon on the taskbar. "
Write-Output " - Hide the Chat (meet now) icon from the taskbar. "
2022-09-08 17:20:53 +02:00
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 " ------------------------------------------------------------------------------------------- "
2023-07-26 23:54:02 +02:00
Write-Output " - Remove bloatware apps, full list can be found on github. (github.com/raphire/win11debloat) "
2022-09-08 17:20:53 +02:00
Write-Output " - Disable telemetry, diagnostic data & targeted ads. "
2023-06-01 11:49:16 +02:00
Write-Output " - Disable bing search, bing AI & cortana in windows search. "
2022-09-08 17:20:53 +02:00
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. "
2023-07-18 00:14:06 +02:00
Write-Output " - Disable the widget service & hide the widget icon on the taskbar. "
Write-Output " - Hide the Chat icon from the taskbar. "
2022-09-08 17:20:53 +02:00
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
2023-05-15 16:38:11 -06:00
switch ( $Mode ) {
'1' {
Clear-Host
2020-11-07 02:57:38 +01:00
Write-Output " ------------------------------------------------------------------------------------------- "
2023-07-26 23:54:02 +02:00
Write-Output " Win11Debloat 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 )
2023-04-24 15:30:25 +02:00
$PSBoundParameters . Add ( 'DisableSuggestions' , $DisableSuggestions )
2022-08-29 19:26:13 +02:00
$PSBoundParameters . Add ( 'DisableWidgets' , $DisableWidgets )
2023-07-27 01:09:58 +02:00
$PSBoundParameters . Add ( 'HideChat' , $HideChat )
$PSBoundParameters . Add ( 'Hide3dObjects' , $Hide3dObjects )
$PSBoundParameters . Add ( 'HideIncludeInLibrary' , $HideIncludeInLibrary )
$PSBoundParameters . Add ( 'HideGiveAccessTo' , $HideGiveAccessTo )
$PSBoundParameters . Add ( 'HideShare' , $HideShare )
2020-11-07 02:57:38 +01:00
}
2022-09-08 17:20:53 +02:00
2023-05-15 16:38:11 -06:00
'2' {
Clear-Host
2021-12-15 21:45:48 +01:00
Write-Output " ------------------------------------------------------------------------------------------- "
2023-07-26 23:54:02 +02:00
Write-Output " Win11Debloat Script - Windows 11 Default Configuration "
2021-12-15 21:45:48 +01:00
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 )
2023-04-24 15:30:25 +02:00
$PSBoundParameters . Add ( 'DisableSuggestions' , $DisableSuggestions )
2022-08-29 19:26:13 +02:00
$PSBoundParameters . Add ( 'DisableWidgets' , $DisableWidgets )
2023-07-27 01:09:58 +02:00
$PSBoundParameters . Add ( 'HideChat' , $HideChat )
2021-12-15 21:45:48 +01:00
}
2022-09-08 17:20:53 +02:00
2023-05-15 16:38:11 -06:00
'3' {
Clear-Host
2020-11-07 02:57:38 +01:00
Write-Output " ------------------------------------------------------------------------------------------- "
2023-07-26 23:54:02 +02:00
Write-Output " Win11Debloat Script - Custom Configuration "
2020-11-07 02:57:38 +01:00
Write-Output " ------------------------------------------------------------------------------------------- "
2023-06-01 11:49:16 +02:00
if ( $ ( Read-Host -Prompt " Remove the pre-installed windows apps? (y/n) " ) -eq 'y' ) {
2020-11-07 02:57:38 +01:00
$PSBoundParameters . Add ( 'RemoveApps' , $RemoveApps )
}
2023-07-18 00:14:06 +02:00
Write-Output " "
2023-05-15 16:38:11 -06:00
if ( $ ( Read-Host -Prompt " Disable telemetry, diagnostic data and targeted ads? (y/n) " ) -eq 'y' ) {
2022-08-29 16:14:36 +02:00
$PSBoundParameters . Add ( 'DisableTelemetry' , $DisableTelemetry )
2020-11-07 02:57:38 +01:00
}
2023-07-18 00:14:06 +02:00
Write-Output " "
2023-06-01 11:49:16 +02:00
if ( $ ( Read-Host -Prompt " Disable bing search, bing AI & cortana in windows search? (y/n) " ) -eq 'y' ) {
2022-09-08 16:38:14 +02:00
$PSBoundParameters . Add ( 'DisableBing' , $DisableBing )
2020-11-07 02:57:38 +01:00
}
2023-07-18 00:14:06 +02:00
Write-Output " "
2023-05-15 16:38:11 -06:00
if ( $ ( Read-Host -Prompt " Disable tips & tricks on the lockscreen? (y/n) " ) -eq 'y' ) {
2020-11-07 02:57:38 +01:00
$PSBoundParameters . Add ( 'DisableLockscreenTips' , $DisableLockscreenTips )
}
2023-07-18 00:14:06 +02:00
Write-Output " "
2023-05-15 16:38:11 -06:00
if ( $ ( Read-Host -Prompt " Disable tips, tricks and suggestions in the startmenu and settings, and ads in windows explorer? (y/n) " ) -eq 'y' ) {
2023-04-24 15:30:25 +02:00
$PSBoundParameters . Add ( 'DisableSuggestions' , $DisableSuggestions )
2020-11-07 02:57:38 +01:00
}
2023-07-18 00:14:06 +02:00
Write-Output " "
if ( $ ( Read-Host -Prompt " Do you want to make any changes to the taskbar? (y/n) " ) -eq 'y' ) {
# Only show option for taskbar alignment in windows 11
if ( get-ciminstance -query " select caption from win32_operatingsystem where caption like '%Windows 11%' " ) {
Write-Output " "
if ( $ ( Read-Host -Prompt " Align taskbar buttons to left side? (y/n) " ) -eq 'y' ) {
$PSBoundParameters . Add ( 'TaskbarAlignLeft' , $TaskbarAlignLeft )
}
2022-08-29 19:26:13 +02:00
}
2023-07-18 00:14:06 +02:00
Write-Output " "
if ( $ ( Read-Host -Prompt " Disable the widgets service and hide the widget (news and interests) icon on the taskbar? (y/n) " ) -eq 'y' ) {
2022-08-29 19:26:13 +02:00
$PSBoundParameters . Add ( 'DisableWidgets' , $DisableWidgets )
}
2023-07-18 00:14:06 +02:00
Write-Output " "
if ( $ ( Read-Host -Prompt " Hide the chat (meet now) icon on the taskbar? (y/n) " ) -eq 'y' ) {
2023-07-27 01:09:58 +02:00
$PSBoundParameters . Add ( 'HideChat' , $HideChat )
2022-08-29 16:14:36 +02:00
}
2023-07-18 00:14:06 +02:00
}
# Only show option for disabling these specific folders in windows 10
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 windows explorer sidepanel? (y/n) " ) -eq 'y' ) {
2020-11-07 02:57:38 +01:00
2023-07-18 00:14:06 +02:00
Write-Output " "
if ( $ ( Read-Host -Prompt " Hide the onedrive folder in windows explorer? (y/n) " ) -eq 'y' ) {
2023-07-27 01:09:58 +02:00
$PSBoundParameters . Add ( 'HideOnedrive' , $HideOnedrive )
2023-07-18 00:14:06 +02:00
}
Write-Output " "
if ( $ ( Read-Host -Prompt " Hide the 3D objects folder in windows explorer? (y/n) " ) -eq 'y' ) {
2023-07-27 01:09:58 +02:00
$PSBoundParameters . Add ( 'Hide3dObjects' , $Hide3dObjects )
2023-06-01 11:49:16 +02:00
}
2023-07-18 00:14:06 +02:00
Write-Output " "
2022-08-29 16:14:36 +02:00
2023-07-18 00:14:06 +02:00
if ( $ ( Read-Host -Prompt " Hide the music folder in windows explorer? (y/n) " ) -eq 'y' ) {
2023-07-27 01:09:58 +02:00
$PSBoundParameters . Add ( 'HideMusic' , $HideMusic )
2023-06-01 11:49:16 +02:00
}
2022-08-29 16:14:36 +02:00
}
2020-11-07 02:57:38 +01:00
}
2023-06-01 11:49:16 +02:00
# Only show option for disabling context menu items in windows 10
if ( get-ciminstance -query " select caption from win32_operatingsystem where caption like '%Windows 10%' " ) {
2023-07-18 00:14:06 +02:00
Write-Output " "
2023-06-01 11:49:16 +02:00
if ( $ ( Read-Host -Prompt " Do you want to disable any context menu options? (y/n) " ) -eq 'y' ) {
2023-07-18 00:14:06 +02:00
Write-Output " "
2023-07-27 01:09:58 +02:00
if ( $ ( Read-Host -Prompt " Hide the 'Include in library' option in the context menu? (y/n) " ) -eq 'y' ) {
$PSBoundParameters . Add ( 'HideIncludeInLibrary' , $HideIncludeInLibrary )
2023-06-01 11:49:16 +02:00
}
2022-08-29 16:14:36 +02:00
2023-07-18 00:14:06 +02:00
Write-Output " "
2023-07-27 01:09:58 +02:00
if ( $ ( Read-Host -Prompt " Hide the 'Give access to' option in the context menu? (y/n) " ) -eq 'y' ) {
$PSBoundParameters . Add ( 'HideGiveAccessTo' , $HideGiveAccessTo )
2023-06-01 11:49:16 +02:00
}
2022-08-29 16:14:36 +02:00
2023-07-18 00:14:06 +02:00
Write-Output " "
2023-07-27 01:09:58 +02:00
if ( $ ( Read-Host -Prompt " Hide the 'Share' option in the context menu? (y/n) " ) -eq 'y' ) {
$PSBoundParameters . Add ( 'HideShare' , $HideShare )
2023-06-01 11:49:16 +02:00
}
2022-08-29 16:14:36 +02:00
}
2020-11-07 02:57:38 +01:00
}
Write-Output " "
}
}
2020-11-06 12:48:13 +01:00
}
2023-05-15 16:38:11 -06:00
else {
Clear-Host
2020-11-07 02:57:38 +01:00
Write-Output " ------------------------------------------------------------------------------------------- "
2023-07-26 23:54:02 +02:00
Write-Output " Win11Debloat Script - Custom Configuration "
2020-11-07 02:57:38 +01:00
Write-Output " ------------------------------------------------------------------------------------------- "
2020-11-06 12:48:13 +01:00
}
2022-04-09 18:52:16 +02:00
# Execute all selected/provided parameters
2023-05-15 16:38:11 -06:00
switch ( $PSBoundParameters . Keys ) {
'RemoveApps' {
2020-11-07 02:57:38 +01:00
RemoveApps
2023-07-27 01:09:58 +02:00
Write-Output " "
continue
2020-11-07 02:57:38 +01:00
}
2023-05-15 16:38:11 -06:00
'DisableTelemetry' {
2022-08-29 16:14:36 +02:00
RegImport " > Disabling telemetry, diagnostic data and targeted ads... " $PSScriptRoot \ Regfiles \ Disable_Telemetry . reg
2023-07-27 01:09:58 +02:00
Write-Output " "
continue
2020-11-07 02:57:38 +01:00
}
2023-05-15 16:38:11 -06:00
'DisableBingSearches' {
2023-06-01 11:49:16 +02:00
RegImport " > Disabling bing search, bing AI & cortana in windows search... " $PSScriptRoot \ Regfiles \ Disable_Bing_Cortana_In_Search . reg
2023-07-27 01:09:58 +02:00
Write-Output " "
continue
2022-09-08 16:38:14 +02:00
}
2023-05-15 16:38:11 -06:00
'DisableBing' {
2023-06-01 11:49:16 +02:00
RegImport " > Disabling bing search, bing AI & cortana in windows search... " $PSScriptRoot \ Regfiles \ Disable_Bing_Cortana_In_Search . reg
2023-07-27 01:09:58 +02:00
Write-Output " "
continue
2020-11-07 02:57:38 +01:00
}
2023-05-15 16:38:11 -06:00
'DisableLockscreenTips' {
2020-11-07 02:57:38 +01:00
RegImport " > Disabling tips & tricks on the lockscreen... " $PSScriptRoot \ Regfiles \ Disable_Lockscreen_Tips . reg
2023-07-27 01:09:58 +02:00
Write-Output " "
continue
2020-11-07 02:57:38 +01:00
}
2023-07-27 01:09:58 +02:00
{ $_ -in " DisableSuggestions " , " 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
2023-07-27 01:09:58 +02:00
Write-Output " "
continue
2022-08-29 19:26:13 +02:00
}
2023-07-27 01:09:58 +02:00
{ $_ -in " HideWidgets " , " DisableWidgets " } {
2023-07-18 00:14:06 +02:00
RegImport " > Disabling the widget service and hiding the widget icon on the taskbar... " $PSScriptRoot \ Regfiles \ Disable_Widgets_Taskbar . reg
2023-07-27 01:09:58 +02:00
Write-Output " "
continue
2023-07-18 00:14:06 +02:00
}
2023-07-27 01:09:58 +02:00
{ $_ -in " HideChat " , " DisableChat " } {
2023-07-18 00:14:06 +02:00
RegImport " > Hiding the chat icon on the taskbar... " $PSScriptRoot \ Regfiles \ Disable_Chat_Taskbar . reg
2023-07-27 01:09:58 +02:00
Write-Output " "
continue
}
'TaskbarAlignLeft' {
RegImport " > Aligning taskbar buttons to the left... " $PSScriptRoot \ Regfiles \ Align_Taskbar_Left . reg
Write-Output " "
continue
2022-08-29 16:14:36 +02:00
}
2023-07-27 01:09:58 +02:00
{ $_ -in " HideOnedrive " , " DisableOnedrive " } {
2022-08-29 16:14:36 +02:00
RegImport " > Hiding the onedrive folder in windows explorer... " $PSScriptRoot \ Regfiles \ Hide_Onedrive_Folder . reg
2023-07-27 01:09:58 +02:00
Write-Output " "
continue
2022-08-29 16:14:36 +02:00
}
2023-07-27 01:09:58 +02:00
{ $_ -in " Hide3dObjects " , " Disable3dObjects " } {
2022-08-29 16:14:36 +02:00
RegImport " > Hiding the 3D objects folder in windows explorer... " $PSScriptRoot \ Regfiles \ Hide_3D_Objects_Folder . reg
2023-07-27 01:09:58 +02:00
Write-Output " "
continue
2022-08-29 16:14:36 +02:00
}
2023-07-27 01:09:58 +02:00
{ $_ -in " HideMusic " , " DisableMusic " } {
2022-08-29 16:14:36 +02:00
RegImport " > Hiding the music folder in windows explorer... " $PSScriptRoot \ Regfiles \ Hide_Music_folder . reg
2023-07-27 01:09:58 +02:00
Write-Output " "
continue
2022-08-29 16:14:36 +02:00
}
2023-07-27 01:09:58 +02:00
{ $_ -in " HideIncludeInLibrary " , " DisableIncludeInLibrary " } {
RegImport " > Hiding 'Include in library' in the context menu... " $PSScriptRoot \ Regfiles \ Disable_Include_in_library_from_context_menu . reg
Write-Output " "
continue
2020-11-07 02:57:38 +01:00
}
2023-07-27 01:09:58 +02:00
{ $_ -in " HideGiveAccessTo " , " DisableGiveAccessTo " } {
RegImport " > Hiding 'Give access to' in the context menu... " $PSScriptRoot \ Regfiles \ Disable_Give_access_to_context_menu . reg
Write-Output " "
continue
2020-11-07 02:57:38 +01:00
}
2023-07-27 01:09:58 +02:00
{ $_ -in " HideShare " , " DisableShare " } {
RegImport " > Hiding 'Share' in the context menu... " $PSScriptRoot \ Regfiles \ Disable_Share_from_context_menu . reg
Write-Output " "
continue
2020-11-07 02:57:38 +01:00
}
2020-10-27 23:26:39 +01:00
}
2023-07-18 00:14:06 +02:00
Write-Output " "
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 " )