Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # This can helps you debloaat windows 11.
- # SAVE IS AS debload.ps1 on your computer
- # You must run PowerShell in Administrator rights and type C:\Type\where\you\saved\your\script\debloat.ps1 and hit enter.
- # Script should automatically run.
- # If you wan keep some Windows Provisioned Apps, just comment as you can see commented my dropbox
- # For example want keep Xbox apps or BingWeather.
- # Any tips for help are welcome. Also, if you wee error in script, please don't hestitate contact me. Thanks
- # Changelog
- # 1.1 Added disabling tracking you by Windows
- # Questions
- # It's better using HKLM or HKCU in regedit? HKLM should be for all system but HKCU has higher priority, right?
- $ErrorActionPreference = "SilentlyContinue"
- Set-ExecutionPolicy Unrestricted
- function ConcatPath($pathArray) {
- $pathResult = ""
- foreach($pathPartial in $pathArray) {
- if ($pathResult -eq "") { $pathResult = $pathArray[0] }
- else { $pathResult += '\' + $pathPartial }
- }
- return $pathResult
- }
- $ArrayWhatMicrosoftSeeOnYourSystem = @(
- #Disabling Lockscreen when you're login
- @("HKLM:\Software\Policies\Microsoft\Windows", "Personalization", "Nolockscreen", "DWord", "1"),
- #Disable Cortana
- @("HKLM:\Software\Policies\Microsoft\Windows", "Windows Search", "AllowCortana", "DWord", "0"),
- #Disable Advertising ID
- @("HKLM:\Software\Microsoft\Windows\CurrentVersion", "AdvertisingInfo", "Enabled", "DWord", "0"),
- #Disable Telemetry
- @("HKLM:\Software\Policies\Microsoft\Windows", "DataCollection", "AllowTelemetry", "DWord", "0"),
- #Disable Suggested cotent
- @("HKLM:\Software\Microsoft\Windows\CurrentVersion", "ContentDeliveryManager", "SubscribedContent-338393Enabled", "DWord", "0"),
- @("HKLM:\Software\Microsoft\Windows\CurrentVersion", "ContentDeliveryManager", "SubscribedContent-338393Enabled", "DWord", "0"),
- @("HKLM:\Software\Microsoft\Windows\CurrentVersion", "ContentDeliveryManager", "SubscribedContent-338393Enabled", "DWord", "0"),
- #Disable Windows improve Start and search results by tracking app launches
- @("HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer", "Advanced", "Start_TrackProgs", "DWord", "0"),
- #Disable Let website show me locally relevant content by accessing my language list
- @("HKLM:\Control Panel\International", "User Profile", "HttpAcceptLanguageOptOut", "DWord", "0")
- )
- foreach($item in $ArrayWhatMicrosoftSeeOnYourSystem) {
- try {
- New-Item -Path $item[0] -Name $item[1] -Force | Out-Null
- New-ItemProperty -Path (ConcatPath($item[0],$item[1])) -Name $item[2] -PropertyType $item[3] -Value $item[4] -Force | Out-Null
- } catch {
- Write-Host("Something Wrong $_")
- }
- }
- $packagesToRemove = @(
- "Microsoft.XboxApp",
- "Microsoft.XboxGameCallableUI",
- "Microsoft.XboxGameOverlay",
- "Microsoft.XboxIdentityProvider",
- "Microsoft.XboxSpeechToTextOverlay"
- # "DropboxInc.Dropbox",
- "Microsoft.BingNews",
- "Microsoft.ZuneMusic",
- "Microsoft.ZuneVideo",
- # "Microsoft.Office.OneNote",
- "Microsoft.MicrosoftStickyNotes",
- "Microsoft.YourPhone",
- "Microsoft.Todos",
- "Microsoft.WindowsMaps",
- # "Microsoft.WindowsSoundRecorder",
- "Microsoft.WindowsStore",
- # "Microsoft.PowerAutomateDesktop",
- "Microsoft.MicrosoftOfficeHub",
- "Microsoft.MicrosoftSolitaireCollection",
- # "Microsoft.GamingApp",
- "Microsoft.BingWeather"
- )
- $provisionedPackages = @(DISM /Online /Get-ProvisionedAppxPackages | select-string PackageName)
- foreach ($provisionedPackage in $ProvisionedPackages) {
- foreach ($packageToRemove in $packagesToRemove) {
- if($provisionedPackage -match $packageToRemove) {
- try {
- $provisionedPackage = $provisionedPackage -replace('^PackageName\s?:\s?(.*)', '$1')
- Remove-ProvisionedAppxPackage -AllUsers -Online -PackageName $provisionedPackage
- Write-Host("$provisionedPackage was removed!")
- } catch {
- Write-Output "Something threw an exception or used Write-Error"
- Write-Output $_
- }
- }
- }
- }
Advertisement
Comments
-
- Please, add me some tips or comments.HKCU or HKLM?
Add Comment
Please, Sign In to add comment
Advertisement