123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455 |
- <#
- $EnableEdgePDFTakeover.Text = "Enable Edge PDF Takeover"
- $EnableEdgePDFTakeover.Width = 185
- $EnableEdgePDFTakeover.Height = 35
- $EnableEdgePDFTakeover.Location = New-Object System.Drawing.Point(155, 260)
- #>
- #This will self elevate the script so with a UAC prompt since this script needs to be run as an Administrator in order to function properly.
- $ErrorActionPreference = 'SilentlyContinue'
- $Button = [System.Windows.MessageBoxButton]::YesNoCancel
- $ErrorIco = [System.Windows.MessageBoxImage]::Error
- $Ask = 'Do you want to run this as an Administrator?
- Select "Yes" to Run as an Administrator
- Select "No" to not run this as an Administrator
-
- Select "Cancel" to stop the script.'
- If (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]'Administrator')) {
- $Prompt = [System.Windows.MessageBox]::Show($Ask, "Run as an Administrator or not?", $Button, $ErrorIco)
- Switch ($Prompt) {
- #This will debloat Windows 10
- Yes {
- Write-Host "You didn't run this script as an Administrator. This script will self elevate to run as an Administrator and continue."
- Start-Process PowerShell.exe -ArgumentList ("-NoProfile -ExecutionPolicy Bypass -File `"{0}`"" -f $PSCommandPath) -Verb RunAs
- Exit
- }
- No {
- Break
- }
- }
- }
- #Unnecessary Windows 10 AppX apps that will be removed by the blacklist.
- $global:Bloatware = @(
- "Microsoft.PPIProjection"
- "Microsoft.BingNews"
- "Microsoft.GetHelp"
- "Microsoft.Getstarted"
- "Microsoft.Messaging"
- "Microsoft.Microsoft3DViewer"
- "Microsoft.MicrosoftOfficeHub"
- "Microsoft.MicrosoftSolitaireCollection"
- "Microsoft.NetworkSpeedTest"
- "Microsoft.News" # Issue 77
- "Microsoft.Office.Lens" # Issue 77
- "Microsoft.Office.OneNote"
- "Microsoft.Office.Sway"
- "Microsoft.OneConnect"
- "Microsoft.People"
- "Microsoft.Print3D"
- "Microsoft.RemoteDesktop" # Issue 120
- "Microsoft.SkypeApp"
- "Microsoft.StorePurchaseApp"
- "Microsoft.Office.Todo.List" # Issue 77
- "Microsoft.Whiteboard" # Issue 77
- "Microsoft.WindowsAlarms"
- "microsoft.windowscommunicationsapps"
- "Microsoft.WindowsFeedbackHub"
- "Microsoft.WindowsMaps"
- "Microsoft.WindowsSoundRecorder"
- "Microsoft.Xbox.TCUI"
- "Microsoft.XboxApp"
- "Microsoft.XboxGameOverlay"
- "Microsoft.XboxGamingOverlay"
- "Microsoft.XboxIdentityProvider"
- "Microsoft.XboxSpeechToTextOverlay"
- "Microsoft.ZuneMusic"
- "Microsoft.ZuneVideo"
- #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" # Issue 123
- "Minecraft"
- "Royal Revolt"
- "Sway" # Issue 77
- "Dolby" # Issue 78
- #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"
- )
- #Valuable Windows 10 AppX apps that most people want to keep. Protected from DeBloat All.
- #Credit to /u/GavinEke for a modified version of my whitelist code
- $global:WhiteListedApps = @(
- "Microsoft.WindowsCalculator" # Microsoft removed legacy calculator
- "Microsoft.WindowsStore" # Issue 1
- "Microsoft.Windows.Photos" # Microsoft disabled/hid legacy photo viewer
- "CanonicalGroupLimited.UbuntuonWindows" # Issue 10
- "Microsoft.Xbox.TCUI" # Issue 25, 91 Many home users want to play games
- "Microsoft.XboxApp"
- "Microsoft.XboxGameOverlay"
- "Microsoft.XboxGamingOverlay" # Issue 25, 91 Many home users want to play games
- "Microsoft.XboxIdentityProvider" # Issue 25, 91 Many home users want to play games
- "Microsoft.XboxSpeechToTextOverlay"
- "Microsoft.MicrosoftStickyNotes" # Issue 33 New functionality.
- "Microsoft.MSPaint" # Issue 32 This is Paint3D, legacy paint still exists in Windows 10
- "Microsoft.WindowsCamera" # Issue 65 New functionality.
- "\.NET"
- "Microsoft.HEIFImageExtension" # Issue 68
- "Microsoft.ScreenSketch" # Issue 55: Looks like Microsoft will be axing snipping tool and using Snip & Sketch going forward
- "Microsoft.StorePurchaseApp" # Issue 68
- "Microsoft.VP9VideoExtensions" # Issue 68
- "Microsoft.WebMediaExtensions" # Issue 68
- "Microsoft.WebpImageExtension" # Issue 68
- "Microsoft.DesktopAppInstaller" # Issue 68
- "WindSynthBerry" # Issue 68
- "MIDIBerry" # Issue 68
- "Slack" # Issue 83
- "*Nvidia*" # Issue 198
- "Microsoft.MixedReality.Portal" # Issue 195
- )
- #NonRemovable Apps that where getting attempted and the system would reject the uninstall, speeds up debloat and prevents 'initalizing' overlay when removing apps
- $NonRemovables = Get-AppxPackage -AllUsers | Where-Object { $_.NonRemovable -eq $true } | ForEach { $_.Name }
- $NonRemovables += Get-AppxPackage | Where-Object { $_.NonRemovable -eq $true } | ForEach { $_.Name }
- $NonRemovables += Get-AppxProvisionedPackage -Online | Where-Object { $_.NonRemovable -eq $true } | ForEach { $_.DisplayName }
- $NonRemovables = $NonRemovables | Sort-Object -Unique
- if ($NonRemovables -eq $null ) {
- # the .NonRemovable property doesn't exist until version 18xx. Use a hard-coded list instead.
- #WARNING: only use exact names here - no short names or wildcards
- $NonRemovables = @(
- "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.HolographicFirstRun" # Added 1709
- "Microsoft.Windows.NarratorQuickStart"
- "Microsoft.Windows.OOBENetworkCaptivePortal" # Added 1709
- "Microsoft.Windows.OOBENetworkConnectionFlow" # Added 1709
- "Microsoft.Windows.ParentalControls"
- "Microsoft.Windows.PeopleExperienceHost"
- "Microsoft.Windows.PinningConfirmationDialog"
- "Microsoft.Windows.SecHealthUI" # Issue 117 Windows Defender
- "Microsoft.Windows.SecondaryTileExperience" # Added 1709
- "Microsoft.Windows.SecureAssessmentBrowser"
- "Microsoft.Windows.ShellExperienceHost"
- "Microsoft.Windows.XGpuEjectDialog"
- "Microsoft.XboxGameCallableUI" # Issue 91
- "Windows.CBSPreview"
- "windows.immersivecontrolpanel"
- "Windows.PrintDialog"
- "Microsoft.VCLibs.140.00"
- "Microsoft.Services.Store.Engagement"
- "Microsoft.UI.Xaml.2.0"
- )
- }
- # import library code - located relative to this script
- Function dotInclude() {
- Param(
- [Parameter(Mandatory)]
- [string]$includeFile
- )
- # Look for the file in the same directory as this script
- $scriptPath = $PSScriptRoot
- if ( $PSScriptRoot -eq $null -and $psISE) {
- $scriptPath = (Split-Path -Path $psISE.CurrentFile.FullPath)
- }
- if ( test-path $scriptPath\$includeFile ) {
- # import and immediately execute the requested file
- . $scriptPath\$includeFile
- }
- }
- # Override built-in blacklist/whitelist with user defined lists
- dotInclude 'custom-lists.ps1'
- #convert to regular expression to allow for the super-useful -match operator
- $global:BloatwareRegex = $global:Bloatware -join '|'
- $global:WhiteListedAppsRegex = $global:WhiteListedApps -join '|'
- # This form was created using POSHGUI.com a free online gui designer for PowerShell
- Add-Type -AssemblyName System.Windows.Forms
- [System.Windows.Forms.Application]::EnableVisualStyles()
- $Form = New-Object system.Windows.Forms.Form
- $Form.ClientSize = New-Object System.Drawing.Point(500,570)
- $Form.StartPosition = 'CenterScreen'
- $Form.FormBorderStyle = 'FixedSingle'
- $Form.MinimizeBox = $false
- $Form.MaximizeBox = $false
- $Form.ShowIcon = $false
- $Form.text = "Windows10Debloader"
- $Form.TopMost = $false
- $Form.BackColor = [System.Drawing.ColorTranslator]::FromHtml("#252525")
- $DebloatPanel = New-Object system.Windows.Forms.Panel
- $DebloatPanel.height = 160
- $DebloatPanel.width = 480
- $DebloatPanel.Anchor = 'top,right,left'
- $DebloatPanel.location = New-Object System.Drawing.Point(10,10)
- $RegistryPanel = New-Object system.Windows.Forms.Panel
- $RegistryPanel.height = 80
- $RegistryPanel.width = 480
- $RegistryPanel.Anchor = 'top,right,left'
- $RegistryPanel.location = New-Object System.Drawing.Point(10,180)
- $CortanaPanel = New-Object system.Windows.Forms.Panel
- $CortanaPanel.height = 120
- $CortanaPanel.width = 153
- $CortanaPanel.Anchor = 'top,right,left'
- $CortanaPanel.location = New-Object System.Drawing.Point(10,270)
- $EdgePanel = New-Object system.Windows.Forms.Panel
- $EdgePanel.height = 120
- $EdgePanel.width = 154
- $EdgePanel.Anchor = 'top,right,left'
- $EdgePanel.location = New-Object System.Drawing.Point(173,270)
- $DarkThemePanel = New-Object system.Windows.Forms.Panel
- $DarkThemePanel.height = 120
- $DarkThemePanel.width = 153
- $DarkThemePanel.Anchor = 'top,right,left'
- $DarkThemePanel.location = New-Object System.Drawing.Point(337,270)
- $OtherPanel = New-Object system.Windows.Forms.Panel
- $OtherPanel.height = 160
- $OtherPanel.width = 480
- $OtherPanel.Anchor = 'top,right,left'
- $OtherPanel.location = New-Object System.Drawing.Point(10,400)
- $Debloat = New-Object system.Windows.Forms.Label
- $Debloat.text = "DEBLOAT OPTIONS"
- $Debloat.AutoSize = $true
- $Debloat.width = 457
- $Debloat.height = 142
- $Debloat.Anchor = 'top,right,left'
- $Debloat.location = New-Object System.Drawing.Point(10,9)
- $Debloat.Font = New-Object System.Drawing.Font('Consolas',15,[System.Drawing.FontStyle]([System.Drawing.FontStyle]::Bold))
- $Debloat.ForeColor = [System.Drawing.ColorTranslator]::FromHtml("#eeeeee")
- $CustomizeBlacklist = New-Object system.Windows.Forms.Button
- $CustomizeBlacklist.FlatStyle = 'Flat'
- $CustomizeBlacklist.text = "CUSTOMISE BLACKLIST"
- $CustomizeBlacklist.width = 460
- $CustomizeBlacklist.height = 30
- $CustomizeBlacklist.Anchor = 'top,right,left'
- $CustomizeBlacklist.location = New-Object System.Drawing.Point(10,40)
- $CustomizeBlacklist.Font = New-Object System.Drawing.Font('Consolas',9)
- $CustomizeBlacklist.ForeColor = [System.Drawing.ColorTranslator]::FromHtml("#eeeeee")
- $RemoveAllBloatware = New-Object system.Windows.Forms.Button
- $RemoveAllBloatware.FlatStyle = 'Flat'
- $RemoveAllBloatware.text = "REMOVE ALL BLOATWARE"
- $RemoveAllBloatware.width = 460
- $RemoveAllBloatware.height = 30
- $RemoveAllBloatware.Anchor = 'top,right,left'
- $RemoveAllBloatware.location = New-Object System.Drawing.Point(10,80)
- $RemoveAllBloatware.Font = New-Object System.Drawing.Font('Consolas',9)
- $RemoveAllBloatware.ForeColor = [System.Drawing.ColorTranslator]::FromHtml("#eeeeee")
- $RemoveBlacklistedBloatware = New-Object system.Windows.Forms.Button
- $RemoveBlacklistedBloatware.FlatStyle = 'Flat'
- $RemoveBlacklistedBloatware.text = "REMOVE BLOATWARE WITH CUSTOM BLACKLIST"
- $RemoveBlacklistedBloatware.width = 460
- $RemoveBlacklistedBloatware.height = 30
- $RemoveBlacklistedBloatware.Anchor = 'top,right,left'
- $RemoveBlacklistedBloatware.location = New-Object System.Drawing.Point(10,120)
- $RemoveBlacklistedBloatware.Font = New-Object System.Drawing.Font('Consolas',9)
- $RemoveBlacklistedBloatware.ForeColor = [System.Drawing.ColorTranslator]::FromHtml("#eeeeee")
- $Registry = New-Object system.Windows.Forms.Label
- $Registry.text = "REGISTRY CHANGES"
- $Registry.AutoSize = $true
- $Registry.width = 457
- $Registry.height = 142
- $Registry.Anchor = 'top,right,left'
- $Registry.location = New-Object System.Drawing.Point(10,10)
- $Registry.Font = New-Object System.Drawing.Font('Consolas',15,[System.Drawing.FontStyle]([System.Drawing.FontStyle]::Bold))
- $Registry.ForeColor = [System.Drawing.ColorTranslator]::FromHtml("#eeeeee")
- $RevertChanges = New-Object system.Windows.Forms.Button
- $RevertChanges.FlatStyle = 'Flat'
- $RevertChanges.text = "REVERT REGISTRY CHANGES"
- $RevertChanges.width = 460
- $RevertChanges.height = 30
- $RevertChanges.Anchor = 'top,right,left'
- $RevertChanges.location = New-Object System.Drawing.Point(10,40)
- $RevertChanges.Font = New-Object System.Drawing.Font('Consolas',9)
- $RevertChanges.ForeColor = [System.Drawing.ColorTranslator]::FromHtml("#eeeeee")
- $Cortana = New-Object system.Windows.Forms.Label
- $Cortana.text = "CORTANA"
- $Cortana.AutoSize = $true
- $Cortana.width = 457
- $Cortana.height = 142
- $Cortana.Anchor = 'top,right,left'
- $Cortana.location = New-Object System.Drawing.Point(10,10)
- $Cortana.Font = New-Object System.Drawing.Font('Consolas',15,[System.Drawing.FontStyle]([System.Drawing.FontStyle]::Bold))
- $Cortana.ForeColor = [System.Drawing.ColorTranslator]::FromHtml("#eeeeee")
- $EnableCortana = New-Object system.Windows.Forms.Button
- $EnableCortana.FlatStyle = 'Flat'
- $EnableCortana.text = "ENABLE"
- $EnableCortana.width = 133
- $EnableCortana.height = 30
- $EnableCortana.Anchor = 'top,right,left'
- $EnableCortana.location = New-Object System.Drawing.Point(10,40)
- $EnableCortana.Font = New-Object System.Drawing.Font('Consolas',9)
- $EnableCortana.ForeColor = [System.Drawing.ColorTranslator]::FromHtml("#eeeeee")
- $DisableCortana = New-Object system.Windows.Forms.Button
- $DisableCortana.FlatStyle = 'Flat'
- $DisableCortana.text = "DISABLE"
- $DisableCortana.width = 133
- $DisableCortana.height = 30
- $DisableCortana.Anchor = 'top,right,left'
- $DisableCortana.location = New-Object System.Drawing.Point(10,80)
- $DisableCortana.Font = New-Object System.Drawing.Font('Consolas',9)
- $DisableCortana.ForeColor = [System.Drawing.ColorTranslator]::FromHtml("#eeeeee")
- $Edge = New-Object system.Windows.Forms.Label
- $Edge.text = "EDGE PDF"
- $Edge.AutoSize = $true
- $Edge.width = 457
- $Edge.height = 142
- $Edge.Anchor = 'top,right,left'
- $Edge.location = New-Object System.Drawing.Point(10,10)
- $Edge.Font = New-Object System.Drawing.Font('Consolas',15,[System.Drawing.FontStyle]([System.Drawing.FontStyle]::Bold))
- $Edge.ForeColor = [System.Drawing.ColorTranslator]::FromHtml("#eeeeee")
- $EnableEdgePDFTakeover = New-Object system.Windows.Forms.Button
- $EnableEdgePDFTakeover.FlatStyle = 'Flat'
- $EnableEdgePDFTakeover.text = "ENABLE"
- $EnableEdgePDFTakeover.width = 134
- $EnableEdgePDFTakeover.height = 30
- $EnableEdgePDFTakeover.Anchor = 'top,right,left'
- $EnableEdgePDFTakeover.location = New-Object System.Drawing.Point(10,40)
- $EnableEdgePDFTakeover.Font = New-Object System.Drawing.Font('Consolas',9)
- $EnableEdgePDFTakeover.ForeColor = [System.Drawing.ColorTranslator]::FromHtml("#eeeeee")
- $DisableEdgePDFTakeover = New-Object system.Windows.Forms.Button
- $DisableEdgePDFTakeover.FlatStyle = 'Flat'
- $DisableEdgePDFTakeover.text = "DISABLE"
- $DisableEdgePDFTakeover.width = 134
- $DisableEdgePDFTakeover.height = 30
- $DisableEdgePDFTakeover.Anchor = 'top,right,left'
- $DisableEdgePDFTakeover.location = New-Object System.Drawing.Point(10,80)
- $DisableEdgePDFTakeover.Font = New-Object System.Drawing.Font('Consolas',9)
- $DisableEdgePDFTakeover.ForeColor = [System.Drawing.ColorTranslator]::FromHtml("#eeeeee")
- $Theme = New-Object system.Windows.Forms.Label
- $Theme.text = "DARK THEME"
- $Theme.AutoSize = $true
- $Theme.width = 457
- $Theme.height = 142
- $Theme.Anchor = 'top,right,left'
- $Theme.location = New-Object System.Drawing.Point(10,10)
- $Theme.Font = New-Object System.Drawing.Font('Consolas',15,[System.Drawing.FontStyle]([System.Drawing.FontStyle]::Bold))
- $Theme.ForeColor = [System.Drawing.ColorTranslator]::FromHtml("#eeeeee")
- $EnableDarkMode = New-Object system.Windows.Forms.Button
- $EnableDarkMode.FlatStyle = 'Flat'
- $EnableDarkMode.text = "ENABLE"
- $EnableDarkMode.width = 133
- $EnableDarkMode.height = 30
- $EnableDarkMode.Anchor = 'top,right,left'
- $EnableDarkMode.location = New-Object System.Drawing.Point(10,40)
- $EnableDarkMode.Font = New-Object System.Drawing.Font('Consolas',9)
- $EnableDarkMode.ForeColor = [System.Drawing.ColorTranslator]::FromHtml("#eeeeee")
- $DisableDarkMode = New-Object system.Windows.Forms.Button
- $DisableDarkMode.FlatStyle = 'Flat'
- $DisableDarkMode.text = "DISABLE"
- $DisableDarkMode.width = 133
- $DisableDarkMode.height = 30
- $DisableDarkMode.Anchor = 'top,right,left'
- $DisableDarkMode.location = New-Object System.Drawing.Point(10,80)
- $DisableDarkMode.Font = New-Object System.Drawing.Font('Consolas',9)
- $DisableDarkMode.ForeColor = [System.Drawing.ColorTranslator]::FromHtml("#eeeeee")
- $Other = New-Object system.Windows.Forms.Label
- $Other.text = "OTHER CHANGES & FIXES"
- $Other.AutoSize = $true
- $Other.width = 457
- $Other.height = 142
- $Other.Anchor = 'top,right,left'
- $Other.location = New-Object System.Drawing.Point(10,10)
- $Other.Font = New-Object System.Drawing.Font('Consolas',15,[System.Drawing.FontStyle]([System.Drawing.FontStyle]::Bold))
- $Other.ForeColor = [System.Drawing.ColorTranslator]::FromHtml("#eeeeee")
- $RemoveOnedrive = New-Object system.Windows.Forms.Button
- $RemoveOnedrive.FlatStyle = 'Flat'
- $RemoveOnedrive.text = "UNINSTALL ONEDRIVE"
- $RemoveOnedrive.width = 225
- $RemoveOnedrive.height = 30
- $RemoveOnedrive.Anchor = 'top,right,left'
- $RemoveOnedrive.location = New-Object System.Drawing.Point(10,40)
- $RemoveOnedrive.Font = New-Object System.Drawing.Font('Consolas',9)
- $RemoveOnedrive.ForeColor = [System.Drawing.ColorTranslator]::FromHtml("#eeeeee")
- $UnpinStartMenuTiles = New-Object system.Windows.Forms.Button
- $UnpinStartMenuTiles.FlatStyle = 'Flat'
- $UnpinStartMenuTiles.text = "UNPIN TILES FROM START MENU"
- $UnpinStartMenuTiles.width = 225
- $UnpinStartMenuTiles.height = 30
- $UnpinStartMenuTiles.Anchor = 'top,right,left'
- $UnpinStartMenuTiles.location = New-Object System.Drawing.Point(245,40)
- $UnpinStartMenuTiles.Font = New-Object System.Drawing.Font('Consolas',9)
- $UnpinStartMenuTiles.ForeColor = [System.Drawing.ColorTranslator]::FromHtml("#eeeeee")
- $DisableTelemetry = New-Object system.Windows.Forms.Button
- $DisableTelemetry.FlatStyle = 'Flat'
- $DisableTelemetry.text = "DISABLE TELEMETRY / TASKS"
- $DisableTelemetry.width = 225
- $DisableTelemetry.height = 30
- $DisableTelemetry.Anchor = 'top,right,left'
- $DisableTelemetry.location = New-Object System.Drawing.Point(10,80)
- $DisableTelemetry.Font = New-Object System.Drawing.Font('Consolas',9)
- $DisableTelemetry.ForeColor = [System.Drawing.ColorTranslator]::FromHtml("#eeeeee")
- $RemoveRegkeys = New-Object system.Windows.Forms.Button
- $RemoveRegkeys.FlatStyle = 'Flat'
- $RemoveRegkeys.text = "REMOVE BLOATWARE REGKEYS"
- $RemoveRegkeys.width = 225
- $RemoveRegkeys.height = 30
- $RemoveRegkeys.Anchor = 'top,right,left'
- $RemoveRegkeys.location = New-Object System.Drawing.Point(245,80)
- $RemoveRegkeys.Font = New-Object System.Drawing.Font('Consolas',9)
- $RemoveRegkeys.ForeColor = [System.Drawing.ColorTranslator]::FromHtml("#eeeeee")
- $InstallNet35 = New-Object system.Windows.Forms.Button
- $InstallNet35.FlatStyle = 'Flat'
- $InstallNet35.text = "INSTALL .NET V3.5"
- $InstallNet35.width = 460
- $InstallNet35.height = 30
- $InstallNet35.Anchor = 'top,right,left'
- $InstallNet35.location = New-Object System.Drawing.Point(10,120)
- $InstallNet35.Font = New-Object System.Drawing.Font('Consolas',9)
- $InstallNet35.ForeColor = [System.Drawing.ColorTranslator]::FromHtml("#eeeeee")
- $Form.controls.AddRange(@($RegistryPanel,$DebloatPanel,$CortanaPanel,$EdgePanel,$DarkThemePanel,$OtherPanel))
- $DebloatPanel.controls.AddRange(@($Debloat,$CustomizeBlacklist,$RemoveAllBloatware,$RemoveBlacklistedBloatware))
- $RegistryPanel.controls.AddRange(@($Registry,$RevertChanges))
- $CortanaPanel.controls.AddRange(@($Cortana,$EnableCortana,$DisableCortana))
- $EdgePanel.controls.AddRange(@($EnableEdgePDFTakeover,$DisableEdgePDFTakeover,$Edge))
- $DarkThemePanel.controls.AddRange(@($Theme,$DisableDarkMode,$EnableDarkMode))
- $OtherPanel.controls.AddRange(@($Other,$RemoveOnedrive,$InstallNet35,$UnpinStartMenuTiles,$DisableTelemetry,$RemoveRegkeys))
- $DebloatFolder = "C:\Temp\Windows10Debloater"
- If (Test-Path $DebloatFolder) {
- Write-Host "${DebloatFolder} exists. Skipping."
- }
- Else {
- Write-Host "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-Host "The folder ${DebloatFolder} was successfully created."
- }
- Start-Transcript -OutputDirectory "${DebloatFolder}"
- #region gui events {
- $CustomizeBlacklist.Add_Click( {
- $CustomizeForm = New-Object System.Windows.Forms.Form
- $CustomizeForm.ClientSize = New-Object System.Drawing.Point(500,570)
- $CustomizeForm.StartPosition = 'CenterScreen'
- $CustomizeForm.FormBorderStyle = 'FixedSingle'
- $CustomizeForm.MinimizeBox = $false
- $CustomizeForm.MaximizeBox = $false
- $CustomizeForm.ShowIcon = $false
- $CustomizeForm.Text = "Customize Whitelist and Blacklist"
- $CustomizeForm.TopMost = $false
- $CustomizeForm.AutoScroll = $false
- $CustomizeForm.BackColor = [System.Drawing.ColorTranslator]::FromHtml("#252525")
- $ListPanel = New-Object system.Windows.Forms.Panel
- $ListPanel.height = 510
- $ListPanel.width = 480
- $ListPanel.Anchor = 'top,right,left'
- $ListPanel.location = New-Object System.Drawing.Point(10,10)
- $ListPanel.AutoScroll = $true
- $ListPanel.BackColor = [System.Drawing.ColorTranslator]::FromHtml("#252525")
- $SaveList = New-Object System.Windows.Forms.Button
- $SaveList.FlatStyle = 'Flat'
- $SaveList.Text = "Save custom Whitelist and Blacklist to custom-lists.ps1"
- $SaveList.width = 480
- $SaveList.height = 30
- $SaveList.Location = New-Object System.Drawing.Point(10, 530)
- $SaveList.Font = New-Object System.Drawing.Font('Consolas',9)
- $SaveList.ForeColor = [System.Drawing.ColorTranslator]::FromHtml("#eeeeee")
- $CustomizeForm.controls.AddRange(@($SaveList,$ListPanel))
- $SaveList.Add_Click( {
- $ErrorActionPreference = 'SilentlyContinue'
- '$global:WhiteListedApps = @(' | Out-File -FilePath $PSScriptRoot\custom-lists.ps1 -Encoding utf8
- @($ListPanel.controls) | ForEach {
- if ($_ -is [System.Windows.Forms.CheckBox] -and $_.Enabled -and !$_.Checked) {
- " ""$( $_.Text )""" | Out-File -FilePath $PSScriptRoot\custom-lists.ps1 -Append -Encoding utf8
- }
- }
- ')' | Out-File -FilePath $PSScriptRoot\custom-lists.ps1 -Append -Encoding utf8
- '$global:Bloatware = @(' | Out-File -FilePath $PSScriptRoot\custom-lists.ps1 -Append -Encoding utf8
- @($ListPanel.controls) | ForEach {
- if ($_ -is [System.Windows.Forms.CheckBox] -and $_.Enabled -and $_.Checked) {
- " ""$($_.Text)""" | Out-File -FilePath $PSScriptRoot\custom-lists.ps1 -Append -Encoding utf8
- }
- }
- ')' | Out-File -FilePath $PSScriptRoot\custom-lists.ps1 -Append -Encoding utf8
- #Over-ride the white/blacklist with the newly saved custom list
- dotInclude custom-lists.ps1
- #convert to regular expression to allow for the super-useful -match operator
- $global:BloatwareRegex = $global:Bloatware -join '|'
- $global:WhiteListedAppsRegex = $global:WhiteListedApps -join '|'
- })
- Function AddAppToCustomizeForm() {
- Param(
- [Parameter(Mandatory)]
- [int] $position,
- [Parameter(Mandatory)]
- [string] $appName,
- [Parameter(Mandatory)]
- [bool] $enabled,
- [Parameter(Mandatory)]
- [bool] $checked,
- [Parameter(Mandatory)]
- [bool] $autocheck,
- [string] $notes
- )
- $label = New-Object System.Windows.Forms.Label
- $label.Location = New-Object System.Drawing.Point(0, (2 + $position * 25))
- $label.Text = $notes
- $label.Font = New-Object System.Drawing.Font('Consolas',8)
- $label.Width = 150
- $label.Height = 16
- $Label.TextAlign = [System.Drawing.ContentAlignment]::TopRight
- $label.ForeColor = [System.Drawing.ColorTranslator]::FromHtml("#888888")
- $ListPanel.controls.AddRange(@($label))
- $Checkbox = New-Object System.Windows.Forms.CheckBox
- $Checkbox.Text = $appName
- $CheckBox.Font = New-Object System.Drawing.Font('Consolas',8)
- $CheckBox.FlatStyle = 'Flat'
- $CheckBox.ForeColor = [System.Drawing.ColorTranslator]::FromHtml("#eeeeee")
- $Checkbox.Location = New-Object System.Drawing.Point(160, (0 + $position * 25))
- $Checkbox.Autosize = 1;
- $Checkbox.Checked = $checked
- $Checkbox.Enabled = $enabled
- $CheckBox.AutoCheck = $autocheck
- $ListPanel.controls.AddRange(@($CheckBox))
- }
- $Installed = @( (Get-AppxPackage).Name )
- $Online = @( (Get-AppxProvisionedPackage -Online).DisplayName )
- $AllUsers = @( (Get-AppxPackage -AllUsers).Name )
- [int]$checkboxCounter = 0
- ForEach ($item in $NonRemovables) {
- $string = ""
- if ( $null -notmatch $global:BloatwareRegex -and $item -cmatch $global:BloatwareRegex ) { $string += " ConflictBlacklist " }
- if ( $null -notmatch $global:WhiteListedAppsRegex -and $item -cmatch $global:WhiteListedAppsRegex ) { $string += " ConflictWhitelist" }
- if ( $null -notmatch $Installed -and $Installed -cmatch $item) { $string += "Installed" }
- if ( $null -notmatch $AllUsers -and $AllUsers -cmatch $item) { $string += " AllUsers" }
- if ( $null -notmatch $Online -and $Online -cmatch $item) { $string += " Online" }
- $string += " NON-REMOVABLE"
- AddAppToCustomizeForm $checkboxCounter $item $true $false $false $string
- ++$checkboxCounter
- }
- ForEach ( $item in $global:WhiteListedApps ) {
- $string = ""
- if ( $null -notmatch $NonRemovables -and $NonRemovables -cmatch $item ) { $string += " Conflict NonRemovables " }
- if ( $null -notmatch $global:BloatwareRegex -and $item -cmatch $global:BloatwareRegex ) { $string += " ConflictBlacklist " }
- if ( $null -notmatch $Installed -and $Installed -cmatch $item) { $string += "Installed" }
- if ( $null -notmatch $AllUsers -and $AllUsers -cmatch $item) { $string += " AllUsers" }
- if ( $null -notmatch $Online -and $Online -cmatch $item) { $string += " Online" }
- AddAppToCustomizeForm $checkboxCounter $item $true $false $true $string
- ++$checkboxCounter
- }
- ForEach ( $item in $global:Bloatware ) {
- $string = ""
- if ( $null -notmatch $NonRemovables -and $NonRemovables -cmatch $item ) { $string += " Conflict NonRemovables " }
- if ( $null -notmatch $global:WhiteListedAppsRegex -and $item -cmatch $global:WhiteListedAppsRegex ) { $string += " Conflict Whitelist " }
- if ( $null -notmatch $Installed -and $Installed -cmatch $item) { $string += "Installed" }
- if ( $null -notmatch $AllUsers -and $AllUsers -cmatch $item) { $string += " AllUsers" }
- if ( $null -notmatch $Online -and $Online -cmatch $item) { $string += " Online" }
- AddAppToCustomizeForm $checkboxCounter $item $true $true $true $string
- ++$checkboxCounter
- }
- ForEach ( $item in $AllUsers ) {
- $string = "NEW AllUsers"
- if ( $null -notmatch $NonRemovables -and $NonRemovables -cmatch $item ) { continue }
- if ( $null -notmatch $global:WhiteListedAppsRegex -and $item -cmatch $global:WhiteListedAppsRegex ) { continue }
- if ( $null -notmatch $global:BloatwareRegex -and $item -cmatch $global:BloatwareRegex ) { continue }
- if ( $null -notmatch $Installed -and $Installed -cmatch $item) { $string += " Installed" }
- if ( $null -notmatch $Online -and $Online -cmatch $item) { $string += " Online" }
- AddAppToCustomizeForm $checkboxCounter $item $true $true $true $string
- ++$checkboxCounter
- }
- ForEach ( $item in $Installed ) {
- $string = "NEW Installed"
- if ( $null -notmatch $NonRemovables -and $NonRemovables -cmatch $item ) { continue }
- if ( $null -notmatch $global:WhiteListedAppsRegex -and $item -cmatch $global:WhiteListedAppsRegex ) { continue }
- if ( $null -notmatch $global:BloatwareRegex -and $item -cmatch $global:BloatwareRegex ) { continue }
- if ( $null -notmatch $AllUsers -and $AllUsers -cmatch $item) { continue }
- if ( $null -notmatch $Online -and $Online -cmatch $item) { $string += " Online" }
- AddAppToCustomizeForm $checkboxCounter $item $true $true $true $string
- ++$checkboxCounter
- }
- ForEach ( $item in $Online ) {
- $string = "NEW Online "
- if ( $null -notmatch $NonRemovables -and $NonRemovables -cmatch $item ) { continue }
- if ( $null -notmatch $global:WhiteListedAppsRegex -and $item -cmatch $global:WhiteListedAppsRegex ) { continue }
- if ( $null -notmatch $global:BloatwareRegex -and $item -cmatch $global:BloatwareRegex ) { continue }
- if ( $null -notmatch $Installed -and $Installed -cmatch $item) { continue }
- if ( $null -notmatch $AllUsers -and $AllUsers -cmatch $item) { continue }
- AddAppToCustomizeForm $checkboxCounter $item $true $true $true $string
- ++$checkboxCounter
- }
- [void]$CustomizeForm.ShowDialog()
- })
- $RemoveBlacklistedBloatware.Add_Click( {
- $ErrorActionPreference = 'SilentlyContinue'
- Function DebloatBlacklist {
- Write-Host "Requesting removal of $global:BloatwareRegex"
- Write-Host "--- This may take a while - please be patient ---"
- Get-AppxPackage | Where-Object Name -cmatch $global:BloatwareRegex | Remove-AppxPackage
- Write-Host "...now starting the silent ProvisionedPackage bloatware removal..."
- Get-AppxProvisionedPackage -Online | Where-Object DisplayName -cmatch $global:BloatwareRegex | Remove-AppxProvisionedPackage -Online
- Write-Host "...and the final cleanup..."
- Get-AppxPackage -AllUsers | Where-Object Name -cmatch $global:BloatwareRegex | Remove-AppxPackage
- }
- Write-Host "`n`n`n`n`n`n`n`n`n`n`n`n`n`n`n`n`nRemoving blacklisted Bloatware.`n"
- DebloatBlacklist
- Write-Host "Bloatware removed!"
- })
- $RemoveAllBloatware.Add_Click( {
- $ErrorActionPreference = 'SilentlyContinue'
- #This function finds any AppX/AppXProvisioned package and uninstalls it, except for Freshpaint, Windows Calculator, Windows Store, and Windows Photos.
- #Also, to note - This does NOT remove essential system services/software/etc such as .NET framework installations, Cortana, Edge, etc.
- #This is the switch parameter for running this script as a 'silent' script, for use in MDT images or any type of mass deployment without user interaction.
- Function Begin-SysPrep {
- Write-Host "Starting Sysprep Fixes"
-
- # Disable Windows Store Automatic Updates
- Write-Host "Adding Registry key to Disable Windows Store Automatic Updates"
- $registryPath = "HKLM:\SOFTWARE\Policies\Microsoft\WindowsStore"
- If (!(Test-Path $registryPath)) {
- Mkdir $registryPath
- New-ItemProperty $registryPath AutoDownload -Value 2
- }
- Set-ItemProperty $registryPath AutoDownload -Value 2
- #Stop WindowsStore Installer Service and set to Disabled
- Write-Host "Stopping InstallService"
- Stop-Service InstallService
- Write-Host "Setting InstallService Startup to Disabled"
- Set-Service InstallService -StartupType Disabled
- }
-
- Function CheckDMWService {
- Param([switch]$Debloat)
-
- If (Get-Service dmwappushservice | Where-Object { $_.StartType -eq "Disabled" }) {
- Set-Service dmwappushservice -StartupType Automatic
- }
- If (Get-Service dmwappushservice | Where-Object { $_.Status -eq "Stopped" }) {
- Start-Service dmwappushservice
- }
- }
- Function DebloatAll {
- #Removes AppxPackages
- Get-AppxPackage | Where { !($_.Name -cmatch $global:WhiteListedAppsRegex) -and !($NonRemovables -cmatch $_.Name) } | Remove-AppxPackage
- Get-AppxProvisionedPackage -Online | Where { !($_.DisplayName -cmatch $global:WhiteListedAppsRegex) -and !($NonRemovables -cmatch $_.DisplayName) } | Remove-AppxProvisionedPackage -Online
- Get-AppxPackage -AllUsers | Where { !($_.Name -cmatch $global:WhiteListedAppsRegex) -and !($NonRemovables -cmatch $_.Name) } | Remove-AppxPackage
- }
-
- #Creates a PSDrive to be able to access the 'HKCR' tree
- New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT
-
- Function Remove-Keys {
- #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-Host "Removing $Key from registry"
- Remove-Item $Key -Recurse
- }
- }
-
- Function Protect-Privacy {
-
- #Creates a PSDrive to be able to access the 'HKCR' tree
- New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT
-
- #Disables Windows Feedback Experience
- Write-Host "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-Host "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
- }
-
- #Stops the Windows Feedback Experience from sending anonymous data
- Write-Host "Stopping the Windows Feedback Experience program"
- $Period1 = 'HKCU:\Software\Microsoft\Siuf'
- $Period2 = 'HKCU:\Software\Microsoft\Siuf\Rules'
- $Period3 = 'HKCU:\Software\Microsoft\Siuf\Rules\PeriodInNanoSeconds'
- If (!(Test-Path $Period3)) {
- mkdir $Period1
- mkdir $Period2
- mkdir $Period3
- New-ItemProperty $Period3 PeriodInNanoSeconds -Value 0
- }
-
- Write-Host "Adding Registry key to prevent bloatware apps from returning"
- #Prevents bloatware applications from returning
- $registryPath = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent"
- If (!(Test-Path $registryPath)) {
- Mkdir $registryPath
- New-ItemProperty $registryPath DisableWindowsConsumerFeatures -Value 1
- }
-
- Write-Host "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 live tiles
- Write-Host "Disabling live tiles"
- $Live = 'HKCU:\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\PushNotifications'
- If (!(Test-Path $Live)) {
- mkdir $Live
- New-ItemProperty $Live NoTileApplicationNotification -Value 1
- }
-
- #Turns off Data Collection via the AllowTelemtry key by changing it to 0
- Write-Host "Turning off Data Collection"
- $DataCollection = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection'
- If (Test-Path $DataCollection) {
- Set-ItemProperty $DataCollection AllowTelemetry -Value 0
- }
-
- #Disables People icon on Taskbar
- Write-Host "Disabling People icon on Taskbar"
- $People = 'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People'
- If (Test-Path $People) {
- Set-ItemProperty $People PeopleBand -Value 0
- }
-
- #Disables suggestions on start menu
- Write-Host "Disabling suggestions on the Start Menu"
- $Suggestions = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager'
- If (Test-Path $Suggestions) {
- Set-ItemProperty $Suggestions SystemPaneSuggestionsEnabled -Value 0
- }
-
-
- Write-Host "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
- }
-
- #Loads the registry keys/values below into the NTUSER.DAT file which prevents the apps from redownloading. Credit to a60wattfish
- reg load HKU\Default_User C:\Users\Default\NTUSER.DAT
- Set-ItemProperty -Path Registry::HKU\Default_User\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name SystemPaneSuggestionsEnabled -Value 0
- Set-ItemProperty -Path Registry::HKU\Default_User\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name PreInstalledAppsEnabled -Value 0
- Set-ItemProperty -Path Registry::HKU\Default_User\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name OemPreInstalledAppsEnabled -Value 0
- reg unload HKU\Default_User
-
- #Disables scheduled tasks that are considered unnecessary
- Write-Host "Disabling scheduled tasks"
- #Get-ScheduledTask -TaskName XblGameSaveTaskLogon | Disable-ScheduledTask
- Get-ScheduledTask -TaskName XblGameSaveTask | Disable-ScheduledTask
- Get-ScheduledTask -TaskName Consolidator | Disable-ScheduledTask
- Get-ScheduledTask -TaskName UsbCeip | Disable-ScheduledTask
- Get-ScheduledTask -TaskName DmClient | Disable-ScheduledTask
- Get-ScheduledTask -TaskName DmClientOnScenarioDownload | Disable-ScheduledTask
- }
- Function UnpinStart {
- #Credit to Vikingat-Rage
- #https://superuser.com/questions/1068382/how-to-remove-all-the-tiles-in-the-windows-10-start-menu
- #Unpins all tiles from the Start Menu
- Write-Host "Unpinning all tiles from the start menu"
- (New-Object -Com Shell.Application).
- NameSpace('shell:::{4234d49b-0245-4df3-b780-3893943456e1}').
- Items() |
- % { $_.Verbs() } |
- ? { $_.Name -match 'Un.*pin from Start' } |
- % { $_.DoIt() }
- }
- Function Remove3dObjects {
- #Removes 3D Objects from the 'My Computer' submenu in explorer
- Write-Output "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
- }
- }
-
- Function CheckDMWService {
- Param([switch]$Debloat)
-
- If (Get-Service dmwappushservice | Where-Object { $_.StartType -eq "Disabled" }) {
- Set-Service dmwappushservice -StartupType Automatic
- }
- If (Get-Service dmwappushservice | Where-Object { $_.Status -eq "Stopped" }) {
- Start-Service dmwappushservice
- }
- }
-
- Function CheckInstallService {
-
- If (Get-Service InstallService | Where-Object { $_.Status -eq "Stopped" }) {
- Start-Service InstallService
- Set-Service InstallService -StartupType Automatic
- }
- }
-
- Write-Host "Initiating Sysprep"
- Begin-SysPrep
- Write-Host "Removing bloatware apps."
- DebloatAll
- Write-Host "Removing leftover bloatware registry keys."
- Remove-Keys
- Write-Host "Checking to see if any Whitelisted Apps were removed, and if so re-adding them."
- FixWhitelistedApps
- Write-Host "Stopping telemetry, disabling unneccessary scheduled tasks, and preventing bloatware from returning."
- Protect-Privacy
- Write-Host "Unpinning tiles from the Start Menu."
- UnpinStart
- Write-Host "Setting the 'InstallService' Windows service back to 'Started' and the Startup Type 'Automatic'."
- CheckDMWService
- CheckInstallService
- Write-Host "Finished all tasks. `n"
-
- } )
- $RevertChanges.Add_Click( {
- $ErrorActionPreference = 'SilentlyContinue'
- #This function will revert the changes you made when running the Start-Debloat function.
-
- #This line reinstalls all of the bloatware that was removed
- Get-AppxPackage -AllUsers | ForEach { Add-AppxPackage -Verbose -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml" }
-
- #Tells Windows to enable your advertising information.
- Write-Host "Re-enabling key to show advertisement information"
- $Advertising = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo"
- If (Test-Path $Advertising) {
- Set-ItemProperty $Advertising Enabled -Value 1
- }
-
- #Enables Cortana to be used as part of your Windows Search Function
- Write-Host "Re-enabling Cortana to be used in your Windows Search"
- $Search = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search"
- If (Test-Path $Search) {
- Set-ItemProperty $Search AllowCortana -Value 1
- }
-
- #Re-enables the Windows Feedback Experience for sending anonymous data
- Write-Host "Re-enabling Windows Feedback Experience"
- $Period = "HKCU:\Software\Microsoft\Siuf\Rules"
- If (!(Test-Path $Period)) {
- New-Item $Period
- }
- Set-ItemProperty $Period PeriodInNanoSeconds -Value 1
-
- #Enables bloatware applications
- Write-Host "Adding Registry key to allow bloatware apps to return"
- $registryPath = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent"
- If (!(Test-Path $registryPath)) {
- New-Item $registryPath
- }
- Set-ItemProperty $registryPath DisableWindowsConsumerFeatures -Value 0
-
- #Changes Mixed Reality Portal Key 'FirstRunSucceeded' to 1
- Write-Host "Setting Mixed Reality Portal value to 1"
- $Holo = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Holographic"
- If (Test-Path $Holo) {
- Set-ItemProperty $Holo FirstRunSucceeded -Value 1
- }
-
- #Re-enables live tiles
- Write-Host "Enabling live tiles"
- $Live = "HKCU:\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\PushNotifications"
- If (!(Test-Path $Live)) {
- New-Item $Live
- }
- Set-ItemProperty $Live NoTileApplicationNotification -Value 0
-
- #Re-enables data collection
- Write-Host "Re-enabling data collection"
- $DataCollection = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection"
- If (!(Test-Path $DataCollection)) {
- New-Item $DataCollection
- }
- Set-ItemProperty $DataCollection AllowTelemetry -Value 1
-
- #Re-enables People Icon on Taskbar
- Write-Host "Enabling People Icon on Taskbar"
- $People = 'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People'
- If (Test-Path $People) {
- Set-ItemProperty $People -Name PeopleBand -Value 1 -Verbose
- }
-
- #Re-enables suggestions on start menu
- Write-Host "Enabling suggestions on the Start Menu"
- $Suggestions = "HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager"
- If (!(Test-Path $Suggestions)) {
- New-Item $Suggestions
- }
- Set-ItemProperty $Suggestions SystemPaneSuggestionsEnabled -Value 1
-
- #Re-enables scheduled tasks that were disabled when running the Debloat switch
- Write-Host "Enabling scheduled tasks that were disabled"
- Get-ScheduledTask XblGameSaveTaskLogon | Enable-ScheduledTask
- Get-ScheduledTask XblGameSaveTask | Enable-ScheduledTask
- Get-ScheduledTask Consolidator | Enable-ScheduledTask
- Get-ScheduledTask UsbCeip | Enable-ScheduledTask
- Get-ScheduledTask DmClient | Enable-ScheduledTask
- Get-ScheduledTask DmClientOnScenarioDownload | Enable-ScheduledTask
- Write-Host "Re-enabling and starting WAP Push Service"
- #Enable and start WAP Push Service
- Set-Service "dmwappushservice" -StartupType Automatic
- Start-Service "dmwappushservice"
-
- Write-Host "Re-enabling and starting the Diagnostics Tracking Service"
- #Enabling the Diagnostics Tracking Service
- Set-Service "DiagTrack" -StartupType Automatic
- Start-Service "DiagTrack"
- Write-Host "Done reverting changes!"
- #
- Write-Output "Restoring 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)) {
- New-Item $Objects32
- }
- If (!(Test-Path $Objects64)) {
- New-Item $Objects64
- }
- })
- $DisableCortana.Add_Click( {
- $ErrorActionPreference = 'SilentlyContinue'
- 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
- Write-Host "Cortana has been disabled."
- })
- $DisableEdgePDFTakeover.Add_Click( {
- $ErrorActionPreference = 'SilentlyContinue'
- #Stops edge from taking over as the default .PDF viewer
- Write-Host "Stopping Edge from taking over as the default .PDF viewer"
- $NoPDF = "HKCR:\.pdf"
- $NoProgids = "HKCR:\.pdf\OpenWithProgids"
- $NoWithList = "HKCR:\.pdf\OpenWithList"
- If (!(Get-ItemProperty $NoPDF NoOpenWith)) {
- New-ItemProperty $NoPDF NoOpenWith
- }
- If (!(Get-ItemProperty $NoPDF NoStaticDefaultVerb)) {
- New-ItemProperty $NoPDF NoStaticDefaultVerb
- }
- If (!(Get-ItemProperty $NoProgids NoOpenWith)) {
- New-ItemProperty $NoProgids NoOpenWith
- }
- If (!(Get-ItemProperty $NoProgids NoStaticDefaultVerb)) {
- New-ItemProperty $NoProgids NoStaticDefaultVerb
- }
- If (!(Get-ItemProperty $NoWithList NoOpenWith)) {
- New-ItemProperty $NoWithList NoOpenWith
- }
- If (!(Get-ItemProperty $NoWithList NoStaticDefaultVerb)) {
- New-ItemProperty $NoWithList NoStaticDefaultVerb
- }
-
- #Appends an underscore '_' to the Registry key for Edge
- $Edge = "HKCR:\AppXd4nrz8ff68srnhf9t5a8sbjyar1cr723_"
- If (Test-Path $Edge) {
- Set-Item $Edge AppXd4nrz8ff68srnhf9t5a8sbjyar1cr723_
- }
- Write-Host "Edge should no longer take over as the default .PDF."
- })
- $EnableCortana.Add_Click( {
- $ErrorActionPreference = 'SilentlyContinue'
- Write-Host "Re-enabling 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 1
- If (!(Test-Path $Cortana2)) {
- New-Item $Cortana2
- }
- Set-ItemProperty $Cortana2 RestrictImplicitTextCollection -Value 0
- Set-ItemProperty $Cortana2 RestrictImplicitInkCollection -Value 0
- If (!(Test-Path $Cortana3)) {
- New-Item $Cortana3
- }
- Set-ItemProperty $Cortana3 HarvestContacts -Value 1
- Write-Host "Cortana has been enabled!"
- })
- $EnableEdgePDFTakeover.Add_Click( {
- New-PSDrive HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT
- $ErrorActionPreference = 'SilentlyContinue'
- Write-Host "Setting Edge back to default"
- $NoPDF = "HKCR:\.pdf"
- $NoProgids = "HKCR:\.pdf\OpenWithProgids"
- $NoWithList = "HKCR:\.pdf\OpenWithList"
- #Sets edge back to default
- If (Get-ItemProperty $NoPDF NoOpenWith) {
- Remove-ItemProperty $NoPDF NoOpenWith
- }
- If (Get-ItemProperty $NoPDF NoStaticDefaultVerb) {
- Remove-ItemProperty $NoPDF NoStaticDefaultVerb
- }
- If (Get-ItemProperty $NoProgids NoOpenWith) {
- Remove-ItemProperty $NoProgids NoOpenWith
- }
- If (Get-ItemProperty $NoProgids NoStaticDefaultVerb) {
- Remove-ItemProperty $NoProgids NoStaticDefaultVerb
- }
- If (Get-ItemProperty $NoWithList NoOpenWith) {
- Remove-ItemProperty $NoWithList NoOpenWith
- }
- If (Get-ItemProperty $NoWithList NoStaticDefaultVerb) {
- Remove-ItemProperty $NoWithList NoStaticDefaultVerb
- }
-
- #Removes an underscore '_' from the Registry key for Edge
- $Edge2 = "HKCR:\AppXd4nrz8ff68srnhf9t5a8sbjyar1cr723_"
- If (Test-Path $Edge2) {
- Set-Item $Edge2 AppXd4nrz8ff68srnhf9t5a8sbjyar1cr723
- }
- Write-Host "Edge will now be able to be used for .PDF."
- })
- $DisableTelemetry.Add_Click( {
- $ErrorActionPreference = 'SilentlyContinue'
- #Disables Windows Feedback Experience
- Write-Host "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-Host "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-Host "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-Host "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-Host "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-Host "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-Host "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-Host "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-Host "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-Host "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-Host "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-Host "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-Host "Uninstalling Telemetry Windows Updates"
- #Uninstalls Some Windows Updates considered to be Telemetry. !WIP!
- #Wusa /Uninstall /KB:3022345 /norestart /quiet
- #Wusa /Uninstall /KB:3068708 /norestart /quiet
- #Wusa /Uninstall /KB:3075249 /norestart /quiet
- #Wusa /Uninstall /KB:3080149 /norestart /quiet
- Write-Host "Stopping and disabling WAP Push Service"
- #Stop and disable WAP Push Service
- Stop-Service "dmwappushservice"
- Set-Service "dmwappushservice" -StartupType Disabled
- Write-Host "Stopping and disabling Diagnostics Tracking Service"
- #Disabling the Diagnostics Tracking Service
- Stop-Service "DiagTrack"
- Set-Service "DiagTrack" -StartupType Disabled
- Write-Host "Telemetry has been disabled!"
- })
- $RemoveRegkeys.Add_Click( {
- $ErrorActionPreference = 'SilentlyContinue'
- $Keys = @(
-
- New-PSDrive HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT
- #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-Host "Removing $Key from registry"
- Remove-Item $Key -Recurse
- }
- Write-Host "Additional bloatware keys have been removed!"
- })
- $UnpinStartMenuTiles.Add_Click( {
- #https://superuser.com/questions/1068382/how-to-remove-all-the-tiles-in-the-windows-10-start-menu
- #Unpins all tiles from the Start Menu
- Write-Host "Unpinning all tiles from the start menu"
- (New-Object -Com Shell.Application).
- NameSpace('shell:::{4234d49b-0245-4df3-b780-3893943456e1}').
- Items() |
- % { $_.Verbs() } |
- ? { $_.Name -match 'Un.*pin from Start' } |
- % { $_.DoIt() }
- })
- $RemoveOnedrive.Add_Click( {
- If (Test-Path "$env:USERPROFILE\OneDrive\*") {
- Write-Host "Files found within the OneDrive folder! Checking to see if a folder named OneDriveBackupFiles exists."
- Start-Sleep 1
-
- If (Test-Path "$env:USERPROFILE\Desktop\OneDriveBackupFiles") {
- Write-Host "A folder named OneDriveBackupFiles already exists on your desktop. All files from your OneDrive location will be moved to that folder."
- }
- else {
- If (!(Test-Path "$env:USERPROFILE\Desktop\OneDriveBackupFiles")) {
- Write-Host "A folder named OneDriveBackupFiles will be created and will be located on your desktop. All files from your OneDrive location will be located in that folder."
- New-item -Path "$env:USERPROFILE\Desktop" -Name "OneDriveBackupFiles"-ItemType Directory -Force
- Write-Host "Successfully created the folder 'OneDriveBackupFiles' on your desktop."
- }
- }
- Start-Sleep 1
- Move-Item -Path "$env:USERPROFILE\OneDrive\*" -Destination "$env:USERPROFILE\Desktop\OneDriveBackupFiles" -Force
- Write-Host "Successfully moved all files/folders from your OneDrive folder to the folder 'OneDriveBackupFiles' on your desktop."
- Start-Sleep 1
- Write-Host "Proceeding with the removal of OneDrive."
- Start-Sleep 1
- }
- Else {
- Write-Host "Either the OneDrive folder does not exist or there are no files to be found in the folder. Proceeding with removal of OneDrive."
- Start-Sleep 1
- Write-Host "Enabling the Group Policy 'Prevent the usage of OneDrive for File Storage'."
- $OneDriveKey = 'HKLM:Software\Policies\Microsoft\Windows\OneDrive'
- If (!(Test-Path $OneDriveKey)) {
- Mkdir $OneDriveKey
- Set-ItemProperty $OneDriveKey -Name OneDrive -Value DisableFileSyncNGSC
- }
- Set-ItemProperty $OneDriveKey -Name OneDrive -Value DisableFileSyncNGSC
- }
- Write-Host "Uninstalling OneDrive. Please wait..."
-
- New-PSDrive HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT
- $onedrive = "$env:SYSTEMROOT\SysWOW64\OneDriveSetup.exe"
- $ExplorerReg1 = "HKCR:\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}"
- $ExplorerReg2 = "HKCR:\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}"
- Stop-Process -Name "OneDrive*"
- Start-Sleep 2
- If (!(Test-Path $onedrive)) {
- $onedrive = "$env:SYSTEMROOT\System32\OneDriveSetup.exe"
- }
- Start-Process $onedrive "/uninstall" -NoNewWindow -Wait
- Start-Sleep 2
- Write-Host "Stopping explorer"
- Start-Sleep 1
- taskkill.exe /F /IM explorer.exe
- Start-Sleep 3
- Write-Host "Removing leftover files"
- If (Test-Path "$env:USERPROFILE\OneDrive") {
- Remove-Item "$env:USERPROFILE\OneDrive" -Force -Recurse
- }
- If (Test-Path "$env:LOCALAPPDATA\Microsoft\OneDrive") {
- Remove-Item "$env:LOCALAPPDATA\Microsoft\OneDrive" -Force -Recurse
- }
- If (Test-Path "$env:PROGRAMDATA\Microsoft OneDrive") {
- Remove-Item "$env:PROGRAMDATA\Microsoft OneDrive" -Force -Recurse
- }
- If (Test-Path "$env:SYSTEMDRIVE\OneDriveTemp") {
- Remove-Item "$env:SYSTEMDRIVE\OneDriveTemp" -Force -Recurse
- }
- Write-Host "Removing OneDrive from windows explorer"
- If (!(Test-Path $ExplorerReg1)) {
- New-Item $ExplorerReg1
- }
- Set-ItemProperty $ExplorerReg1 System.IsPinnedToNameSpaceTree -Value 0
- If (!(Test-Path $ExplorerReg2)) {
- New-Item $ExplorerReg2
- }
- Set-ItemProperty $ExplorerReg2 System.IsPinnedToNameSpaceTree -Value 0
- Write-Host "Restarting Explorer that was shut down before."
- Start-Process explorer.exe -NoNewWindow
- Write-Host "OneDrive has been successfully uninstalled!"
-
- Remove-item env:OneDrive
- })
- $InstallNet35.Add_Click( {
- Write-Host "Initializing the installation of .NET 3.5..."
- DISM /Online /Enable-Feature /FeatureName:NetFx3 /All
- Write-Host ".NET 3.5 has been successfully installed!"
- } )
- $EnableDarkMode.Add_Click( {
- Write-Host "Enabling Dark Mode"
- $Theme = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize"
- Set-ItemProperty $Theme AppsUseLightTheme -Value 0
- Start-Sleep 1
- Write-Host "Enabled"
- }
- )
- $DisableDarkMode.Add_Click( {
- Write-Host "Disabling Dark Mode"
- $Theme = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize"
- Set-ItemProperty $Theme AppsUseLightTheme -Value 1
- Start-Sleep 1
- Write-Host "Disabled"
- }
- )
- [void]$Form.ShowDialog()
|