1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183 |
- Add-Type -AssemblyName System.Windows.Forms
- [System.Windows.Forms.Application]::EnableVisualStyles()
- #region begin GUI{
- $Form = New-Object system.Windows.Forms.Form
- $Form.ClientSize = '408,523'
- $Form.text = "Windows10Debloater"
- $Form.TopMost = $false
- $Debloat = New-Object system.Windows.Forms.Label
- $Debloat.text = "Debloat Options"
- $Debloat.AutoSize = $true
- $Debloat.width = 25
- $Debloat.height = 10
- $Debloat.location = New-Object System.Drawing.Point(9, 8)
- $Debloat.Font = 'Microsoft Sans Serif,12,style=Bold,Underline'
- $RemoveAllBloatware = New-Object system.Windows.Forms.Button
- $RemoveAllBloatware.text = "Remove All Bloatware"
- $RemoveAllBloatware.width = 142
- $RemoveAllBloatware.height = 40
- $RemoveAllBloatware.location = New-Object System.Drawing.Point(8, 32)
- $RemoveAllBloatware.Font = 'Microsoft Sans Serif,10'
- $RemoveBlacklist = New-Object system.Windows.Forms.Button
- $RemoveBlacklist.text = "Remove Bloatware With Blacklist"
- $RemoveBlacklist.width = 205
- $RemoveBlacklist.height = 37
- $RemoveBlacklist.location = New-Object System.Drawing.Point(9, 79)
- $RemoveBlacklist.Font = 'Microsoft Sans Serif,10'
- $Label1 = New-Object system.Windows.Forms.Label
- $Label1.text = "Revert Debloat "
- $Label1.AutoSize = $true
- $Label1.width = 25
- $Label1.height = 10
- $Label1.location = New-Object System.Drawing.Point(254, 7)
- $Label1.Font = 'Microsoft Sans Serif,12,style=Bold,Underline'
- $RevertChange = New-Object system.Windows.Forms.Button
- $RevertChange.text = "Revert Changes"
- $RevertChange.width = 113
- $RevertChange.height = 36
- $RevertChange.location = New-Object System.Drawing.Point(254, 32)
- $RevertChange.Font = 'Microsoft Sans Serif,10'
- $Label2 = New-Object system.Windows.Forms.Label
- $Label2.text = "Optional Privacy Changes/Fixes"
- $Label2.AutoSize = $true
- $Label2.width = 25
- $Label2.height = 10
- $Label2.location = New-Object System.Drawing.Point(9, 193)
- $Label2.Font = 'Microsoft Sans Serif,12,style=Bold,Underline'
- $DisableCortana = New-Object system.Windows.Forms.Button
- $DisableCortana.text = "Disable Cortana"
- $DisableCortana.width = 111
- $DisableCortana.height = 36
- $DisableCortana.location = New-Object System.Drawing.Point(9, 217)
- $DisableCortana.Font = 'Microsoft Sans Serif,10'
- $EnableCortana = New-Object system.Windows.Forms.Button
- $EnableCortana.text = "Enable Cortana"
- $EnableCortana.width = 112
- $EnableCortana.height = 36
- $EnableCortana.location = New-Object System.Drawing.Point(9, 260)
- $EnableCortana.Font = 'Microsoft Sans Serif,10'
- $StopEdgePDFTakeover = New-Object system.Windows.Forms.Button
- $StopEdgePDFTakeover.text = "Stop Edge PDF Takeover"
- $StopEdgePDFTakeover.width = 161
- $StopEdgePDFTakeover.height = 38
- $StopEdgePDFTakeover.location = New-Object System.Drawing.Point(130, 217)
- $StopEdgePDFTakeover.Font = 'Microsoft Sans Serif,10'
- $EnableEdgePDFTakeover = New-Object system.Windows.Forms.Button
- $EnableEdgePDFTakeover.text = "Enable Edge PDF Takeover"
- $EnableEdgePDFTakeover.width = 177
- $EnableEdgePDFTakeover.height = 39
- $EnableEdgePDFTakeover.location = New-Object System.Drawing.Point(130, 260)
- $EnableEdgePDFTakeover.Font = 'Microsoft Sans Serif,10'
- $DisableTelemetry = New-Object system.Windows.Forms.Button
- $DisableTelemetry.text = "Disable Telemetry/Tasks"
- $DisableTelemetry.width = 152
- $DisableTelemetry.height = 35
- $DisableTelemetry.location = New-Object System.Drawing.Point(9, 303)
- $DisableTelemetry.Font = 'Microsoft Sans Serif,10'
- $RemoveRegkeys = New-Object system.Windows.Forms.Button
- $RemoveRegkeys.text = "Remove Bloatware Regkeys"
- $RemoveRegkeys.width = 177
- $RemoveRegkeys.height = 40
- $RemoveRegkeys.location = New-Object System.Drawing.Point(169, 303)
- $RemoveRegkeys.Font = 'Microsoft Sans Serif,10'
- $RemoveOnedrive = New-Object system.Windows.Forms.Button
- $RemoveOnedrive.text = "Uninstall OneDrive"
- $RemoveOnedrive.width = 117
- $RemoveOnedrive.height = 35
- $RemoveOnedrive.location = New-Object System.Drawing.Point(9, 345)
- $RemoveOnedrive.Font = 'Microsoft Sans Serif,10'
- $FixWhitelist = New-Object system.Windows.Forms.Button
- $FixWhitelist.text = "Fix Whitelisted Apps"
- $FixWhitelist.width = 130
- $FixWhitelist.height = 37
- $FixWhitelist.location = New-Object System.Drawing.Point(254, 74)
- $FixWhitelist.Font = 'Microsoft Sans Serif,10'
- $RemoveBloatNoBlacklist = New-Object system.Windows.Forms.Button
- $RemoveBloatNoBlacklist.text = "Remove Bloatware Without Blacklist"
- $RemoveBloatNoBlacklist.width = 223
- $RemoveBloatNoBlacklist.height = 39
- $RemoveBloatNoBlacklist.location = New-Object System.Drawing.Point(9, 123)
- $RemoveBloatNoBlacklist.Font = 'Microsoft Sans Serif,10'
- $Form.controls.AddRange(@($Debloat, $RemoveAllBloatware, $RemoveBlacklist, $Label1, $RevertChange, $Label2, $DisableCortana, $EnableCortana, $StopEdgePDFTakeover, $EnableEdgePDFTakeover, $DisableTelemetry, $RemoveRegkeys, $RemoveOnedrive, $FixWhitelist, $RemoveBloatNoBlacklist))
- #region gui events {
- $RemoveBlacklist.Add_Click( {
- $ErrorActionPreference = 'silentlycontinue'
- Function DebloatBlacklist {
- [CmdletBinding()]
-
- Param ()
-
- $Bloatware = @(
-
- #Unnecessary Windows 10 AppX Apps
- "Microsoft.BingNews"
- "Microsoft.DesktopAppInstaller"
- "Microsoft.GetHelp"
- "Microsoft.Getstarted"
- "Microsoft.Messaging"
- "Microsoft.Microsoft3DViewer"
- "Microsoft.MicrosoftOfficeHub"
- "Microsoft.MicrosoftSolitaireCollection"
- "Microsoft.NetworkSpeedTest"
- "Microsoft.Office.OneNote"
- "Microsoft.Office.Sway"
- "Microsoft.OneConnect"
- "Microsoft.People"
- "Microsoft.Print3D"
- "Microsoft.RemoteDesktop"
- "Microsoft.SkypeApp"
- "Microsoft.StorePurchaseApp"
- "Microsoft.WindowsAlarms"
- "Microsoft.WindowsCamera"
- "microsoft.windowscommunicationsapps"
- "Microsoft.WindowsFeedbackHub"
- "Microsoft.WindowsMaps"
- "Microsoft.WindowsSoundRecorder"
- "Microsoft.Xbox.TCUI"
- "Microsoft.XboxApp"
- "Microsoft.XboxGameOverlay"
- "Microsoft.XboxIdentityProvider"
- "Microsoft.XboxSpeechToTextOverlay"
- "Microsoft.ZuneMusic"
- "Microsoft.ZuneVideo"
-
- #Sponsored Windows 10 AppX Apps
- #Add sponsored/featured apps to remove in the "*AppName*" format
- "*EclipseManager*"
- "*ActiproSoftwareLLC*"
- "*AdobeSystemsIncorporated.AdobePhotoshopExpress*"
- "*Duolingo-LearnLanguagesforFree*"
- "*PandoraMediaInc*"
- "*CandyCrush*"
- "*Wunderlist*"
- "*Flipboard*"
- "*Twitter*"
- "*Facebook*"
- "*Spotify*"
- "*Minecraft*"
- "*Royal Revolt*"
-
- #Optional: Typically not removed but you can if you need to for some reason
- #"*Microsoft.Advertising.Xaml_10.1712.5.0_x64__8wekyb3d8bbwe*"
- #"*Microsoft.Advertising.Xaml_10.1712.5.0_x86__8wekyb3d8bbwe*"
- #"*Microsoft.BingWeather*"
- #"*Microsoft.MSPaint*"
- #"*Microsoft.MicrosoftStickyNotes*"
- #"*Microsoft.Windows.Photos*"
- #"*Microsoft.WindowsCalculator*"
- #"*Microsoft.WindowsStore*"
- )
- foreach ($Bloat in $Bloatware) {
- Get-AppxPackage -Name $Bloat| Remove-AppxPackage -ErrorAction SilentlyContinue
- Get-AppxProvisionedPackage -Online | Where-Object DisplayName -like $Bloat | Remove-AppxProvisionedPackage -Online -ErrorAction SilentlyContinue
- Write-Host "Trying to remove $Bloat."
- Write-Host "Bloatware removed! `n"
- }
- }
- Write-Host "Removing Bloatware with a specific blacklist."
- DebloatBlacklist
- })
- $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 {
- $ErrorActionPreference = 'silentlycontinue'
- Write-Host -Message ('Starting Sysprep Fixes')
-
- # Disable Windows Store Automatic Updates
- Write-Host -Message "Adding Registry key to Disable Windows Store Automatic Updates"
- $registryPath = "HKLM:\SOFTWARE\Policies\Microsoft\WindowsStore"
- If (!(Test-Path $registryPath)) {
- Mkdir $registryPath -ErrorAction SilentlyContinue
- New-ItemProperty $registryPath -Name AutoDownload -Value 2
- }
- Else {
- Set-ItemProperty $registryPath -Name AutoDownload -Value 2
- }
- #Stop WindowsStore Installer Service and set to Disabled
- Write-Host -Message ('Stopping InstallService')
- Stop-Service InstallService
- Write-Host -Message ('Setting InstallService Startup to Disabled')
- & Set-Service -Name InstallService -StartupType Disabled
- }
- Function DebloatAll {
-
- [CmdletBinding()]
-
- Param()
-
- #Removes AppxPackages
- #Credit to /u/GavinEke for a modified version of my whitelist code
- [regex]$WhitelistedApps = 'Microsoft.ScreenSketch|Microsoft.ScreenSketch|Microsoft.Paint3D|Microsoft.WindowsCalculator|Microsoft.WindowsStore|Microsoft.Windows.Photos|CanonicalGroupLimited.UbuntuonWindows|Microsoft.XboxGameCallableUI|Microsoft.XboxGamingOverlay|Microsoft.Xbox.TCUI|Microsoft.XboxGamingOverlay|Microsoft.XboxIdentityProvider|Microsoft.MicrosoftStickyNotes|Microsoft.MSPaint'
- Get-AppxPackage -AllUsers | Where-Object {$_.Name -NotMatch $WhitelistedApps} | Remove-AppxPackage
- Get-AppxPackage | Where-Object {$_.Name -NotMatch $WhitelistedApps} | Remove-AppxPackage
- Get-AppxProvisionedPackage -Online | Where-Object {$_.PackageName -NotMatch $WhitelistedApps} | Remove-AppxProvisionedPackage -Online
- }
-
- #Creates a PSDrive to be able to access the 'HKCR' tree
- New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT
- Function DebloatBlacklist {
- $ErrorActionPreference = 'silentlycontinue'
- $Bloatware = @(
-
- #Unnecessary Windows 10 AppX Apps
- "Microsoft.BingNews"
- "Microsoft.DesktopAppInstaller"
- "Microsoft.GetHelp"
- "Microsoft.Getstarted"
- "Microsoft.Messaging"
- "Microsoft.Microsoft3DViewer"
- "Microsoft.MicrosoftOfficeHub"
- "Microsoft.MicrosoftSolitaireCollection"
- "Microsoft.NetworkSpeedTest"
- "Microsoft.Office.OneNote"
- "Microsoft.Office.Sway"
- "Microsoft.OneConnect"
- "Microsoft.People"
- "Microsoft.Print3D"
- "Microsoft.RemoteDesktop"
- "Microsoft.SkypeApp"
- "Microsoft.StorePurchaseApp"
- "Microsoft.WindowsAlarms"
- "Microsoft.WindowsCamera"
- "microsoft.windowscommunicationsapps"
- "Microsoft.WindowsFeedbackHub"
- "Microsoft.WindowsMaps"
- "Microsoft.WindowsSoundRecorder"
- "Microsoft.Xbox.TCUI"
- "Microsoft.XboxApp"
- "Microsoft.XboxGameOverlay"
- "Microsoft.XboxIdentityProvider"
- "Microsoft.XboxSpeechToTextOverlay"
- "Microsoft.ZuneMusic"
- "Microsoft.ZuneVideo"
-
- #Sponsored Windows 10 AppX Apps
- #Add sponsored/featured apps to remove in the "*AppName*" format
- "*EclipseManager*"
- "*ActiproSoftwareLLC*"
- "*AdobeSystemsIncorporated.AdobePhotoshopExpress*"
- "*Duolingo-LearnLanguagesforFree*"
- "*PandoraMediaInc*"
- "*CandyCrush*"
- "*Wunderlist*"
- "*Flipboard*"
- "*Twitter*"
- "*Facebook*"
- "*Spotify*"
- "*Minecraft*"
- "*Royal Revolt*"
-
- #Optional: Typically not removed but you can if you need to for some reason
- #"*Microsoft.Advertising.Xaml_10.1712.5.0_x64__8wekyb3d8bbwe*"
- #"*Microsoft.Advertising.Xaml_10.1712.5.0_x86__8wekyb3d8bbwe*"
- #"*Microsoft.BingWeather*"
- #"*Microsoft.MSPaint*"
- #"*Microsoft.MicrosoftStickyNotes*"
- #"*Microsoft.Windows.Photos*"
- #"*Microsoft.WindowsCalculator*"
- #"*Microsoft.WindowsStore*"
- )
- foreach ($Bloat in $Bloatware) {
- Get-AppxPackage -Name $Bloat| Remove-AppxPackage -ErrorAction SilentlyContinue
- Get-AppxProvisionedPackage -Online | Where-Object DisplayName -like $Bloat | Remove-AppxProvisionedPackage -Online -ErrorAction SilentlyContinue
- Write-Host "Trying to remove $Bloat."
- }
- }
-
- Function Remove-Keys {
- $ErrorActionPreference = 'silentlycontinue'
-
- #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 -ErrorAction SilentlyContinue
- }
- }
-
- Function Protect-Privacy {
- $ErrorActionPreference = 'silentlycontinue'
-
- #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 -Name Enabled -Value 0 -Verbose
- }
-
- #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 -Name AllowCortana -Value 0 -Verbose
- }
-
- #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 -ErrorAction SilentlyContinue
- mkdir $Period2 -ErrorAction SilentlyContinue
- mkdir $Period3 -ErrorAction SilentlyContinue
- New-ItemProperty $Period3 -Name PeriodInNanoSeconds -Value 0 -Verbose -ErrorAction SilentlyContinue
- }
-
- 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 -ErrorAction SilentlyContinue
- New-ItemProperty $registryPath -Name DisableWindowsConsumerFeatures -Value 1 -Verbose -ErrorAction SilentlyContinue
- }
-
- 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 -Name FirstRunSucceeded -Value 0 -Verbose
- }
-
- #Disables live tiles
- Write-Host "Disabling live tiles"
- $Live = 'HKCU:\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\PushNotifications'
- If (!(Test-Path $Live)) {
- mkdir $Live -ErrorAction SilentlyContinue
- New-ItemProperty $Live -Name NoTileApplicationNotification -Value 1 -Verbose
- }
-
- #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 -Name AllowTelemetry -Value 0 -Verbose
- }
-
- #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)) {
- mkdir $People -ErrorAction SilentlyContinue
- New-ItemProperty $People -Name PeopleBand -Value 0 -Verbose
- }
-
- #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 -Name SystemPaneSuggestionsEnabled -Value 0 -Verbose
- }
-
- #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 -ErrorAction SilentlyContinue
- Get-ScheduledTask -TaskName XblGameSaveTask | Disable-ScheduledTask -ErrorAction SilentlyContinue
- Get-ScheduledTask -TaskName Consolidator | Disable-ScheduledTask -ErrorAction SilentlyContinue
- Get-ScheduledTask -TaskName UsbCeip | Disable-ScheduledTask -ErrorAction SilentlyContinue
- Get-ScheduledTask -TaskName DmClient | Disable-ScheduledTask -ErrorAction SilentlyContinue
- Get-ScheduledTask -TaskName DmClientOnScenarioDownload | Disable-ScheduledTask -ErrorAction SilentlyContinue
- }
-
- #This includes fixes by xsisbest
- Function FixWhitelistedApps {
- $ErrorActionPreference = 'silentlycontinue'
-
- If (!(Get-AppxPackage -AllUsers | Select Microsoft.Paint3D, Microsoft.MSPaint, Microsoft.WindowsCalculator, Microsoft.WindowsStore, Microsoft.MicrosoftStickyNotes, Microsoft.WindowsSoundRecorder, Microsoft.Windows.Photos)) {
-
- #Credit to abulgatz for the 4 lines of code
- Get-AppxPackage -allusers Microsoft.Paint3D | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
- Get-AppxPackage -allusers Microsoft.MSPaint | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
- Get-AppxPackage -allusers Microsoft.WindowsCalculator | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
- Get-AppxPackage -allusers Microsoft.WindowsStore | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
- Get-AppxPackage -allusers Microsoft.MicrosoftStickyNotes | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
- Get-AppxPackage -allusers Microsoft.WindowsSoundRecorder | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
- Get-AppxPackage -allusers Microsoft.Windows.Photos | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
- }
- }
-
- Function CheckService {
-
- If (Get-Service -Name dmwappushservice | Where-Object {$_.Status -eq "Stopped"}) {
- Start-Service -Name dmwappushservice
- }
- }
-
- Function CheckInstallService {
-
- If (Get-Service -Name InstallService | Where-Object ($_.Status -eq "Stopped"}) {
- Start-Service -Name InstallService
- Set-Service -Name InstallService -StartupType Automatic
- }
- }
-
- Write-Host "Initiating Sysprep"
- Begin-SysPrep
- Write-Host "Removing bloatware apps."
- DebloatAll
- DebloatBlacklist
- 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 "Stopping Edge from taking over as the default PDF Viewer."
- #Stop-EdgePDF
- Write-Output "Setting the 'InstallService' Windows service back to "Started" and the Startup Type "Automatic".
- CheckInstallService
- Write-Host "Finished all tasks. `n"
-
- } )
- $RemoveBloatNoBlacklist.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.
- param (
- [switch]$Debloat, [switch]$SysPrep
- )
-
- Function Begin-SysPrep {
- $ErrorActionPreference = 'silentlycontinue'
-
- param([switch]$SysPrep)
- Write-Host -Message ('Starting Sysprep Fixes')
-
- # Disable Windows Store Automatic Updates
- Write-Host -Message "Adding Registry key to Disable Windows Store Automatic Updates"
- $registryPath = "HKLM:\SOFTWARE\Policies\Microsoft\WindowsStore"
- If (!(Test-Path $registryPath)) {
- Mkdir $registryPath -ErrorAction SilentlyContinue
- New-ItemProperty $registryPath -Name AutoDownload -Value 2
- }
- Else {
- Set-ItemProperty $registryPath -Name AutoDownload -Value 2
- }
- #Stop WindowsStore Installer Service and set to Disabled
- Write-Host -Message ('Stopping InstallService')
- Stop-Service InstallService
- Write-Host -Message ('Setting InstallService Startup to Disabled')
- & Set-Service -Name InstallService -StartupType Disabled
- }
-
- #Creates a PSDrive to be able to access the 'HKCR' tree
- New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT
- Function Start-Debloat {
- $ErrorActionPreference = 'silentlycontinue'
-
- param([switch]$Debloat)
-
- #Removes AppxPackages
- #Credit to Reddit user /u/GavinEke for a modified version of my whitelist code
- [regex]$WhitelistedApps = 'Microsoft.ScreenSketch|Microsoft.Paint3D|Microsoft.MSPaint|Microsoft.WindowsCalculator|Microsoft.WindowsStore|Microsoft.MicrosoftStickyNotes|Microsoft.WindowsSoundRecorder|Microsoft.Windows.Photos|CanonicalGroupLimited.UbuntuonWindows'
- Get-AppxPackage -AllUsers | Where-Object {$_.Name -NotMatch $WhitelistedApps} | Remove-AppxPackage -ErrorAction SilentlyContinue
- # Run this again to avoid error on 1803 or having to reboot.
- Get-AppxPackage -AllUsers | Where-Object {$_.Name -NotMatch $WhitelistedApps} | Remove-AppxPackage -ErrorAction SilentlyContinue
- Get-AppxProvisionedPackage -Online | Where-Object {$_.PackageName -NotMatch $WhitelistedApps} | Remove-AppxProvisionedPackage -Online -ErrorAction SilentlyContinue
- }
-
- Function Remove-Keys {
- $ErrorActionPreference = 'silentlycontinue'
-
- Param([switch]$Debloat)
-
- #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 -ErrorAction SilentlyContinue
- }
- }
-
- Function Protect-Privacy {
- $ErrorActionPreference = 'silentlycontinue'
-
- Param([switch]$Debloat)
-
- #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 -Name Enabled -Value 0 -Verbose
- }
-
- #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 -Name AllowCortana -Value 0 -Verbose
- }
-
- #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 -ErrorAction SilentlyContinue
- mkdir $Period2 -ErrorAction SilentlyContinue
- mkdir $Period3 -ErrorAction SilentlyContinue
- New-ItemProperty $Period3 -Name PeriodInNanoSeconds -Value 0 -Verbose -ErrorAction SilentlyContinue
- }
-
- 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 -ErrorAction SilentlyContinue
- New-ItemProperty $registryPath -Name DisableWindowsConsumerFeatures -Value 1 -Verbose -ErrorAction SilentlyContinue
- }
-
- 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 -Name FirstRunSucceeded -Value 0 -Verbose
- }
-
- #Disables live tiles
- Write-Host "Disabling live tiles"
- $Live = 'HKCU:\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\PushNotifications'
- If (!(Test-Path $Live)) {
- mkdir $Live -ErrorAction SilentlyContinue
- New-ItemProperty $Live -Name NoTileApplicationNotification -Value 1 -Verbose
- }
-
- #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 -Name AllowTelemetry -Value 0 -Verbose
- }
-
- #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)) {
- mkdir $People -ErrorAction SilentlyContinue
- New-ItemProperty $People -Name PeopleBand -Value 0 -Verbose
- }
-
- #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 -Name SystemPaneSuggestionsEnabled -Value 0 -Verbose
- }
-
- #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 -ErrorAction SilentlyContinue
- Get-ScheduledTask -TaskName XblGameSaveTask | Disable-ScheduledTask -ErrorAction SilentlyContinue
- Get-ScheduledTask -TaskName Consolidator | Disable-ScheduledTask -ErrorAction SilentlyContinue
- Get-ScheduledTask -TaskName UsbCeip | Disable-ScheduledTask -ErrorAction SilentlyContinue
- Get-ScheduledTask -TaskName DmClient | Disable-ScheduledTask -ErrorAction SilentlyContinue
- Get-ScheduledTask -TaskName DmClientOnScenarioDownload | Disable-ScheduledTask -ErrorAction SilentlyContinue
- }
-
- #This includes fixes by xsisbest
- Function FixWhitelistedApps {
-
- Param([switch]$Debloat)
-
- If (!(Get-AppxPackage -AllUsers | Select Microsoft.Paint3D, Microsoft.MSPaint, Microsoft.WindowsCalculator, Microsoft.WindowsStore, Microsoft.MicrosoftStickyNotes, Microsoft.WindowsSoundRecorder, Microsoft.Windows.Photos)) {
-
- #Credit to abulgatz for the 4 lines of code
- Get-AppxPackage -allusers Microsoft.Paint3D | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
- Get-AppxPackage -allusers Microsoft.MSPaint | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
- Get-AppxPackage -allusers Microsoft.WindowsCalculator | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
- Get-AppxPackage -allusers Microsoft.WindowsStore | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
- Get-AppxPackage -allusers Microsoft.MicrosoftStickyNotes | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
- Get-AppxPackage -allusers Microsoft.WindowsSoundRecorder | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
- Get-AppxPackage -allusers Microsoft.Windows.Photos | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
- }
- }
-
- Function CheckService {
-
- Param([switch]$Debloat)
-
- If (Get-Service -Name dmwappushservice | Where-Object {$_.Status -eq "Stopped"}) {
- Start-Service -Name dmwappushservice
- }
- }
- Begin-SysPrep
- Write-Host "Removing bloatware apps."
- Start-Debloat
- 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 "Stopping Edge from taking over as the default PDF Viewer."
- Write-Host "Checking to make sure that the service 'dmwappushservice' has been started."
- CheckService
- Write-Host "Finished all tasks. `n"
-
- })
- $RevertChange.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)) {
- New-Item $People
- }
- Set-ItemProperty $People PeopleBand -Value 1
-
- #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! `n"
- })
- $FixWhitelist.Add_Click( {
- $ErrorActionPreference = 'silentlycontinue'
- If (!(Get-AppxPackage -AllUsers | Select Microsoft.Paint3D, Microsoft.WindowsCalculator, Microsoft.WindowsStore, Microsoft.Windows.Photos)) {
-
- #Credit to abulgatz for these 4 lines of code
- Get-AppxPackage -allusers Microsoft.Paint3D | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
- Get-AppxPackage -allusers Microsoft.WindowsCalculator | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
- Get-AppxPackage -allusers Microsoft.WindowsStore | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
- Get-AppxPackage -allusers Microsoft.Windows.Photos | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
- }
-
- Write-Host "Whitelisted apps were either fixed or re-added. `n"
- })
- $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. `n"
- })
- $StopEdgePDFTakeover.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. `n"
- })
- $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! `n"
- })
- $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. `n"
- })
- $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)) {
- New-Item $People
- }
- Set-ItemProperty $People 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! `n"
- })
- $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! `n"
- })
- $RemoveOnedrive.Add_Click( {
- 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"
- Remove-Item "$env:USERPROFILE\OneDrive" -Force -Recurse
- Remove-Item "$env:LOCALAPPDATA\Microsoft\OneDrive" -Force -Recurse
- 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! `n"
- })
- #endregion events }
- #endregion GUI }
- [void]$Form.ShowDialog()
|