Windows10DebloaterGUIExperimental.ps1 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537
  1. Add-Type -AssemblyName System.Windows.Forms
  2. Add-Type -AssemblyName System.Drawing
  3. $ErrorPreference = 'SilentlyContinue'
  4. $VerbosePreference = 'Continue'
  5. $form = New-Object System.Windows.Forms.Form
  6. $form.Text = 'Windows10Debloater'
  7. $form.Size = New-Object System.Drawing.Size(1000,600)
  8. $form.StartPosition = 'CenterScreen'
  9. $OKButton = New-Object System.Windows.Forms.Button
  10. $OKButton.Location = New-Object System.Drawing.Point(275,40)
  11. $OKButton.Size = New-Object System.Drawing.Size(225,23)
  12. $OKButton.Text = 'Remove Selected Bloatware Packages'
  13. $OKButton.DialogResult = [System.Windows.Forms.DialogResult]::OK
  14. $form.AcceptButton = $OKButton
  15. $form.Controls.Add($OKButton)
  16. $ProtectPrivacy = New-Object system.Windows.Forms.Button
  17. $ProtectPrivacy.text = "Disable Telemetry"
  18. $ProtectPrivacy.width = 265
  19. $ProtectPrivacy.height = 23
  20. $ProtectPrivacy.location = New-Object System.Drawing.Point(275,365)
  21. $form.Controls.Add($ProtectPrivacy)
  22. #$WhitelistDebloat.Font = 'Microsoft Sans Serif,10'
  23. $RemoveKeys = New-Object system.Windows.Forms.Button
  24. $RemoveKeys.text = "Remove registry keys associated with Bloatware"
  25. $RemoveKeys.width = 265
  26. $RemoveKeys.height = 23
  27. $RemoveKeys.location = New-Object System.Drawing.Point(275,400)
  28. $form.Controls.Add($RemoveKeys)
  29. #$WhitelistDebloat.Font = 'Microsoft Sans Serif,10'
  30. $RevertChange = New-Object system.Windows.Forms.Button
  31. $RevertChange.text = "Revert Changes made by this utility"
  32. $RevertChange.width = 265
  33. $RevertChange.height = 23
  34. $RevertChange.location = New-Object System.Drawing.Point(275,435)
  35. $form.Controls.Add($RevertChange)
  36. #$WhitelistDebloat.Font = 'Microsoft Sans Serif,10'
  37. $EnableCortana = New-Object system.Windows.Forms.Button
  38. $EnableCortana.text = "Enable Cortana"
  39. $EnableCortana.width = 265
  40. $EnableCortana.height = 23
  41. $EnableCortana.location = New-Object System.Drawing.Point(575,365)
  42. $form.Controls.Add($EnableCortana)
  43. #$WhitelistDebloat.Font = 'Microsoft Sans Serif,10'
  44. $DisableCortana = New-Object system.Windows.Forms.Button
  45. $DisableCortana.text = "Disable Cortana"
  46. $DisableCortana.width = 265
  47. $DisableCortana.height = 23
  48. $DisableCortana.location = New-Object System.Drawing.Point(575,400)
  49. $form.Controls.Add($DisableCortana)
  50. #$WhitelistDebloat.Font = 'Microsoft Sans Serif,10'
  51. $UnpinStartMenuTiles = New-Object system.Windows.Forms.Button
  52. $UnpinStartMenuTiles.text = "Unpin Start Menu Tiles"
  53. $UnpinStartMenuTiles.width = 265
  54. $UnpinStartMenuTiles.height = 23
  55. $UnpinStartMenuTiles.location = New-Object System.Drawing.Point(575,435)
  56. $form.Controls.Add($UnpinStartMenuTiles)
  57. #$WhitelistDebloat.Font = 'Microsoft Sans Serif,10'
  58. $label = New-Object System.Windows.Forms.Label
  59. $label.Location = New-Object System.Drawing.Point(10,20)
  60. $label.Size = New-Object System.Drawing.Size(280,20)
  61. $label.Text = 'Select Default Bloatware Packages To Remove:'
  62. $form.Controls.Add($label)
  63. $listBox = New-Object System.Windows.Forms.ListBox
  64. $listBox.Location = New-Object System.Drawing.Point(10,40)
  65. $listBox.Size = New-Object System.Drawing.Size(260,500)
  66. #$listBox.Height = 80
  67. $label2 = New-Object System.Windows.Forms.Label
  68. $label2.Location = New-Object System.Drawing.Point(275,145)
  69. $label2.Size = New-Object System.Drawing.Size(280,30)
  70. $label2.Text = 'This is used to remove other packages besides the ones chosen on the left hand side'
  71. $form.Controls.Add($label2)
  72. $label3 = New-Object System.Windows.Forms.Label
  73. $label3.Location = New-Object System.Drawing.Point(275,285)
  74. $label3.Size = New-Object System.Drawing.Size(500,15)
  75. $label3.Text = '_______________________________________________________________________________'
  76. $form.Controls.Add($label3)
  77. $label4 = New-Object System.Windows.Forms.Label
  78. $label4.Location = New-Object System.Drawing.Point(275,265)
  79. $label4.Size = New-Object System.Drawing.Size(500,100)
  80. $label4.Text = 'ADVANCED OPTIONS BELOW'
  81. $form.Controls.Add($label4)
  82. $WhitelistDebloat = New-Object system.Windows.Forms.Button
  83. $WhitelistDebloat.text = "Remove extra packages besides the default bloatware"
  84. $WhitelistDebloat.width = 285
  85. $WhitelistDebloat.height = 30
  86. $WhitelistDebloat.location = New-Object System.Drawing.Point(275,175)
  87. #$WhitelistDebloat.Font = 'Microsoft Sans Serif,10'
  88. $Form.controls.AddRange(@($WhitelistDebloat,$RemoveKeys,$ProtectPrivacy))
  89. $WhitelistDebloat.Add_Click({
  90. Function DebloatAll {
  91. #Removes AppxPackages
  92. #Credit to /u/GavinEke for a modified version of my whitelist code
  93. $WhitelistedApps = 'Microsoft.ScreenSketch|Microsoft.Paint3D|Microsoft.WindowsCalculator|Microsoft.WindowsStore|Microsoft.Windows.Photos|CanonicalGroupLimited.UbuntuonWindows|`
  94. Microsoft.XboxGameCallableUI|Microsoft.XboxGamingOverlay|Microsoft.Xbox.TCUI|Microsoft.XboxGamingOverlay|Microsoft.XboxIdentityProvider|Microsoft.MicrosoftStickyNotes|Microsoft.MSPaint|Microsoft.WindowsCamera|.NET|Framework|`
  95. Microsoft.HEIFImageExtension|Microsoft.ScreenSketch|Microsoft.StorePurchaseApp|Microsoft.VP9VideoExtensions|Microsoft.WebMediaExtensions|Microsoft.WebpImageExtension|Microsoft.DesktopAppInstaller|WindSynthBerry|MIDIBerry|Slack'
  96. #NonRemovable Apps that where getting attempted and the system would reject the uninstall, speeds up debloat and prevents 'initalizing' overlay when removing apps
  97. $NonRemovable = '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|`
  98. Microsoft.BioEnrollment|Microsoft.CredDialogHost|Microsoft.ECApp|Microsoft.LockApp|Microsoft.MicrosoftEdgeDevToolsClient|Microsoft.MicrosoftEdge|Microsoft.PPIProjection|Microsoft.Win32WebViewHost|Microsoft.Windows.Apprep.ChxApp|`
  99. Microsoft.Windows.AssignedAccessLockApp|Microsoft.Windows.CapturePicker|Microsoft.Windows.CloudExperienceHost|Microsoft.Windows.ContentDeliveryManager|Microsoft.Windows.Cortana|Microsoft.Windows.NarratorQuickStart|`
  100. Microsoft.Windows.ParentalControls|Microsoft.Windows.PeopleExperienceHost|Microsoft.Windows.PinningConfirmationDialog|Microsoft.Windows.SecHealthUI|Microsoft.Windows.SecureAssessmentBrowser|Microsoft.Windows.ShellExperienceHost|`
  101. Microsoft.Windows.XGpuEjectDialog|Microsoft.XboxGameCallableUI|Windows.CBSPreview|windows.immersivecontrolpanel|Windows.PrintDialog|Microsoft.VCLibs.140.00|Microsoft.Services.Store.Engagement|Microsoft.UI.Xaml.2.0'
  102. Get-AppxPackage -AllUsers | Where {$_.Name -NotMatch $WhitelistedApps -and $_.Name -NotMatch $NonRemovable} | Remove-AppxPackage
  103. Get-AppxPackage | Where {$_.Name -NotMatch $WhitelistedApps -and $_.Name -NotMatch $NonRemovable} | Remove-AppxPackage
  104. Get-AppxProvisionedPackage -Online | Where {$_.Name -NotMatch $WhitelistedApps -and $_.Name -NotMatch $NonRemovable} | Remove-AppxProvisionedPackage -Online
  105. }
  106. Debloatall
  107. })
  108. Try {
  109. New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT
  110. }
  111. Catch {$_
  112. }
  113. $RemoveKeys.Add_Click({
  114. Function Remove-Keys {
  115. New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT
  116. #These are the registry keys that it will delete.
  117. $Keys = @(
  118. #Remove Background Tasks
  119. "HKCR:\Extensions\ContractId\Windows.BackgroundTasks\PackageId\46928bounde.EclipseManager_2.2.4.51_neutral__a5h4egax66k6y"
  120. "HKCR:\Extensions\ContractId\Windows.BackgroundTasks\PackageId\ActiproSoftwareLLC.562882FEEB491_2.6.18.18_neutral__24pqs290vpjk0"
  121. "HKCR:\Extensions\ContractId\Windows.BackgroundTasks\PackageId\Microsoft.MicrosoftOfficeHub_17.7909.7600.0_x64__8wekyb3d8bbwe"
  122. "HKCR:\Extensions\ContractId\Windows.BackgroundTasks\PackageId\Microsoft.PPIProjection_10.0.15063.0_neutral_neutral_cw5n1h2txyewy"
  123. "HKCR:\Extensions\ContractId\Windows.BackgroundTasks\PackageId\Microsoft.XboxGameCallableUI_1000.15063.0.0_neutral_neutral_cw5n1h2txyewy"
  124. "HKCR:\Extensions\ContractId\Windows.BackgroundTasks\PackageId\Microsoft.XboxGameCallableUI_1000.16299.15.0_neutral_neutral_cw5n1h2txyewy"
  125. #Windows File
  126. "HKCR:\Extensions\ContractId\Windows.File\PackageId\ActiproSoftwareLLC.562882FEEB491_2.6.18.18_neutral__24pqs290vpjk0"
  127. #Registry keys to delete if they aren't uninstalled by RemoveAppXPackage/RemoveAppXProvisionedPackage
  128. "HKCR:\Extensions\ContractId\Windows.Launch\PackageId\46928bounde.EclipseManager_2.2.4.51_neutral__a5h4egax66k6y"
  129. "HKCR:\Extensions\ContractId\Windows.Launch\PackageId\ActiproSoftwareLLC.562882FEEB491_2.6.18.18_neutral__24pqs290vpjk0"
  130. "HKCR:\Extensions\ContractId\Windows.Launch\PackageId\Microsoft.PPIProjection_10.0.15063.0_neutral_neutral_cw5n1h2txyewy"
  131. "HKCR:\Extensions\ContractId\Windows.Launch\PackageId\Microsoft.XboxGameCallableUI_1000.15063.0.0_neutral_neutral_cw5n1h2txyewy"
  132. "HKCR:\Extensions\ContractId\Windows.Launch\PackageId\Microsoft.XboxGameCallableUI_1000.16299.15.0_neutral_neutral_cw5n1h2txyewy"
  133. #Scheduled Tasks to delete
  134. "HKCR:\Extensions\ContractId\Windows.PreInstalledConfigTask\PackageId\Microsoft.MicrosoftOfficeHub_17.7909.7600.0_x64__8wekyb3d8bbwe"
  135. #Windows Protocol Keys
  136. "HKCR:\Extensions\ContractId\Windows.Protocol\PackageId\ActiproSoftwareLLC.562882FEEB491_2.6.18.18_neutral__24pqs290vpjk0"
  137. "HKCR:\Extensions\ContractId\Windows.Protocol\PackageId\Microsoft.PPIProjection_10.0.15063.0_neutral_neutral_cw5n1h2txyewy"
  138. "HKCR:\Extensions\ContractId\Windows.Protocol\PackageId\Microsoft.XboxGameCallableUI_1000.15063.0.0_neutral_neutral_cw5n1h2txyewy"
  139. "HKCR:\Extensions\ContractId\Windows.Protocol\PackageId\Microsoft.XboxGameCallableUI_1000.16299.15.0_neutral_neutral_cw5n1h2txyewy"
  140. #Windows Share Target
  141. "HKCR:\Extensions\ContractId\Windows.ShareTarget\PackageId\ActiproSoftwareLLC.562882FEEB491_2.6.18.18_neutral__24pqs290vpjk0"
  142. )
  143. #This writes the output of each key it is removing and also removes the keys listed above.
  144. ForEach ($Key in $Keys) {
  145. Write-Verbose "Removing $Key from registry"
  146. Remove-Item $Key -Recurse
  147. }
  148. }
  149. Remove-Keys
  150. })
  151. $ProtectPrivacy.Add_Click({
  152. Function ProtectPrivacy {
  153. #Creates a PSDrive to be able to access the 'HKCR' tree
  154. New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT
  155. #Disables Windows Feedback Experience
  156. Write-Host "Disabling Windows Feedback Experience program"
  157. $Advertising = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo'
  158. If (Test-Path $Advertising) {
  159. Set-ItemProperty $Advertising Enabled -Value 0
  160. }
  161. #Stops Cortana from being used as part of your Windows Search Function
  162. Write-Host "Stopping Cortana from being used as part of your Windows Search Function"
  163. $Search = 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search'
  164. If (Test-Path $Search) {
  165. Set-ItemProperty $Search AllowCortana -Value 0
  166. }
  167. #Stops the Windows Feedback Experience from sending anonymous data
  168. Write-Host "Stopping the Windows Feedback Experience program"
  169. $Period1 = 'HKCU:\Software\Microsoft\Siuf'
  170. $Period2 = 'HKCU:\Software\Microsoft\Siuf\Rules'
  171. $Period3 = 'HKCU:\Software\Microsoft\Siuf\Rules\PeriodInNanoSeconds'
  172. If (!(Test-Path $Period3)) {
  173. mkdir $Period1
  174. mkdir $Period2
  175. mkdir $Period3
  176. New-ItemProperty $Period3 PeriodInNanoSeconds -Value 0
  177. }
  178. Write-Host "Adding Registry key to prevent bloatware apps from returning"
  179. #Prevents bloatware applications from returning
  180. $registryPath = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent"
  181. If (!(Test-Path $registryPath)) {
  182. Mkdir $registryPath
  183. New-ItemProperty $registryPath DisableWindowsConsumerFeatures -Value 1
  184. }
  185. Write-Host "Setting Mixed Reality Portal value to 0 so that you can uninstall it in Settings"
  186. $Holo = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Holographic'
  187. If (Test-Path $Holo) {
  188. Set-ItemProperty $Holo FirstRunSucceeded -Value 0
  189. }
  190. #Disables live tiles
  191. Write-Host "Disabling live tiles"
  192. $Live = 'HKCU:\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\PushNotifications'
  193. If (!(Test-Path $Live)) {
  194. mkdir $Live
  195. New-ItemProperty $Live NoTileApplicationNotification -Value 1
  196. }
  197. #Turns off Data Collection via the AllowTelemtry key by changing it to 0
  198. Write-Host "Turning off Data Collection"
  199. $DataCollection = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection'
  200. If (Test-Path $DataCollection) {
  201. Set-ItemProperty $DataCollection AllowTelemetry -Value 0
  202. }
  203. #Disables People icon on Taskbar
  204. Write-Host "Disabling People icon on Taskbar"
  205. $People = 'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People'
  206. If (Test-Path $People) {
  207. Set-ItemProperty $People PeopleBand -Value 0
  208. }
  209. #Disables suggestions on start menu
  210. Write-Host "Disabling suggestions on the Start Menu"
  211. $Suggestions = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager'
  212. If (Test-Path $Suggestions) {
  213. Set-ItemProperty $Suggestions SystemPaneSuggestionsEnabled -Value 0
  214. }
  215. Write-Host "Removing CloudStore from registry if it exists"
  216. $CloudStore = 'HKCUSoftware\Microsoft\Windows\CurrentVersion\CloudStore'
  217. If (Test-Path $CloudStore) {
  218. Stop-Process Explorer.exe -Force
  219. Remove-Item $CloudStore
  220. Start-Process Explorer.exe -Wait
  221. }
  222. #Loads the registry keys/values below into the NTUSER.DAT file which prevents the apps from redownloading. Credit to a60wattfish
  223. reg load HKU\Default_User C:\Users\Default\NTUSER.DAT
  224. Set-ItemProperty -Path Registry::HKU\Default_User\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name SystemPaneSuggestionsEnabled -Value 0
  225. Set-ItemProperty -Path Registry::HKU\Default_User\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name PreInstalledAppsEnabled -Value 0
  226. Set-ItemProperty -Path Registry::HKU\Default_User\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name OemPreInstalledAppsEnabled -Value 0
  227. reg unload HKU\Default_User
  228. #Disables scheduled tasks that are considered unnecessary
  229. Write-Host "Disabling scheduled tasks"
  230. #Get-ScheduledTask -TaskName XblGameSaveTaskLogon | Disable-ScheduledTask
  231. Get-ScheduledTask -TaskName XblGameSaveTask | Disable-ScheduledTask
  232. Get-ScheduledTask -TaskName Consolidator | Disable-ScheduledTask
  233. Get-ScheduledTask -TaskName UsbCeip | Disable-ScheduledTask
  234. Get-ScheduledTask -TaskName DmClient | Disable-ScheduledTask
  235. Get-ScheduledTask -TaskName DmClientOnScenarioDownload | Disable-ScheduledTask
  236. }
  237. ProtectPrivacy
  238. })
  239. $RevertChange.Add_Click( {
  240. Function RevertChanges {
  241. $ErrorActionPreference = 'silentlycontinue'
  242. #This function will revert the changes you made when running the Start-Debloat function.
  243. #This line reinstalls all of the bloatware that was removed
  244. Get-AppxPackage -AllUsers | ForEach {Add-AppxPackage -Verbose -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
  245. #Tells Windows to enable your advertising information.
  246. Write-Host "Re-enabling key to show advertisement information"
  247. $Advertising = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo"
  248. If (Test-Path $Advertising) {
  249. Set-ItemProperty $Advertising Enabled -Value 1
  250. }
  251. #Enables Cortana to be used as part of your Windows Search Function
  252. Write-Host "Re-enabling Cortana to be used in your Windows Search"
  253. $Search = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search"
  254. If (Test-Path $Search) {
  255. Set-ItemProperty $Search AllowCortana -Value 1
  256. }
  257. #Re-enables the Windows Feedback Experience for sending anonymous data
  258. Write-Host "Re-enabling Windows Feedback Experience"
  259. $Period = "HKCU:\Software\Microsoft\Siuf\Rules"
  260. If (!(Test-Path $Period)) {
  261. New-Item $Period
  262. }
  263. Set-ItemProperty $Period PeriodInNanoSeconds -Value 1
  264. #Enables bloatware applications
  265. Write-Host "Adding Registry key to allow bloatware apps to return"
  266. $registryPath = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent"
  267. If (!(Test-Path $registryPath)) {
  268. New-Item $registryPath
  269. }
  270. Set-ItemProperty $registryPath DisableWindowsConsumerFeatures -Value 0
  271. #Changes Mixed Reality Portal Key 'FirstRunSucceeded' to 1
  272. Write-Host "Setting Mixed Reality Portal value to 1"
  273. $Holo = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Holographic"
  274. If (Test-Path $Holo) {
  275. Set-ItemProperty $Holo FirstRunSucceeded -Value 1
  276. }
  277. #Re-enables live tiles
  278. Write-Host "Enabling live tiles"
  279. $Live = "HKCU:\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\PushNotifications"
  280. If (!(Test-Path $Live)) {
  281. New-Item $Live
  282. }
  283. Set-ItemProperty $Live NoTileApplicationNotification -Value 0
  284. #Re-enables data collection
  285. Write-Host "Re-enabling data collection"
  286. $DataCollection = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection"
  287. If (!(Test-Path $DataCollection)) {
  288. New-Item $DataCollection
  289. }
  290. Set-ItemProperty $DataCollection AllowTelemetry -Value 1
  291. #Re-enables People Icon on Taskbar
  292. Write-Host "Enabling People Icon on Taskbar"
  293. $People = 'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People'
  294. If (Test-Path $People) {
  295. Set-ItemProperty $People -Name PeopleBand -Value 1 -Verbose
  296. }
  297. #Re-enables suggestions on start menu
  298. Write-Host "Enabling suggestions on the Start Menu"
  299. $Suggestions = "HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager"
  300. If (!(Test-Path $Suggestions)) {
  301. New-Item $Suggestions
  302. }
  303. Set-ItemProperty $Suggestions SystemPaneSuggestionsEnabled -Value 1
  304. #Re-enables scheduled tasks that were disabled when running the Debloat switch
  305. Write-Host "Enabling scheduled tasks that were disabled"
  306. Get-ScheduledTask XblGameSaveTaskLogon | Enable-ScheduledTask
  307. Get-ScheduledTask XblGameSaveTask | Enable-ScheduledTask
  308. Get-ScheduledTask Consolidator | Enable-ScheduledTask
  309. Get-ScheduledTask UsbCeip | Enable-ScheduledTask
  310. Get-ScheduledTask DmClient | Enable-ScheduledTask
  311. Get-ScheduledTask DmClientOnScenarioDownload | Enable-ScheduledTask
  312. Write-Host "Re-enabling and starting WAP Push Service"
  313. #Enable and start WAP Push Service
  314. Set-Service "dmwappushservice" -StartupType Automatic
  315. Start-Service "dmwappushservice"
  316. Write-Host "Re-enabling and starting the Diagnostics Tracking Service"
  317. #Enabling the Diagnostics Tracking Service
  318. Set-Service "DiagTrack" -StartupType Automatic
  319. Start-Service "DiagTrack"
  320. Write-Host "Done reverting changes!"
  321. #
  322. Write-Output "Restoring 3D Objects from explorer 'My Computer' submenu"
  323. $Objects32 = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{0DB7E03F-FC29-4DC6-9020-FF41B59E513A}"
  324. $Objects64 = "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{0DB7E03F-FC29-4DC6-9020-FF41B59E513A}"
  325. If (!(Test-Path $Objects32)) {
  326. New-Item $Objects32
  327. }
  328. If (!(Test-Path $Objects64)) {
  329. New-Item $Objects64
  330. }
  331. }
  332. RevertChanges
  333. })
  334. $DisableCortana.Add_Click( {
  335. Function DisableCortana {
  336. $ErrorActionPreference = 'silentlycontinue'
  337. Write-Host "Disabling Cortana"
  338. $Cortana1 = "HKCU:\SOFTWARE\Microsoft\Personalization\Settings"
  339. $Cortana2 = "HKCU:\SOFTWARE\Microsoft\InputPersonalization"
  340. $Cortana3 = "HKCU:\SOFTWARE\Microsoft\InputPersonalization\TrainedDataStore"
  341. If (!(Test-Path $Cortana1)) {
  342. New-Item $Cortana1
  343. }
  344. Set-ItemProperty $Cortana1 AcceptedPrivacyPolicy -Value 0
  345. If (!(Test-Path $Cortana2)) {
  346. New-Item $Cortana2
  347. }
  348. Set-ItemProperty $Cortana2 RestrictImplicitTextCollection -Value 1
  349. Set-ItemProperty $Cortana2 RestrictImplicitInkCollection -Value 1
  350. If (!(Test-Path $Cortana3)) {
  351. New-Item $Cortana3
  352. }
  353. Set-ItemProperty $Cortana3 HarvestContacts -Value 0
  354. Write-Host "Cortana has been disabled."
  355. }
  356. DisableCortana
  357. })
  358. $EnableCortana.Add_Click( {
  359. Function EnableCortana {
  360. $ErrorActionPreference = 'silentlycontinue'
  361. Write-Host "Re-enabling Cortana"
  362. $Cortana1 = "HKCU:\SOFTWARE\Microsoft\Personalization\Settings"
  363. $Cortana2 = "HKCU:\SOFTWARE\Microsoft\InputPersonalization"
  364. $Cortana3 = "HKCU:\SOFTWARE\Microsoft\InputPersonalization\TrainedDataStore"
  365. If (!(Test-Path $Cortana1)) {
  366. New-Item $Cortana1
  367. }
  368. Set-ItemProperty $Cortana1 AcceptedPrivacyPolicy -Value 1
  369. If (!(Test-Path $Cortana2)) {
  370. New-Item $Cortana2
  371. }
  372. Set-ItemProperty $Cortana2 RestrictImplicitTextCollection -Value 0
  373. Set-ItemProperty $Cortana2 RestrictImplicitInkCollection -Value 0
  374. If (!(Test-Path $Cortana3)) {
  375. New-Item $Cortana3
  376. }
  377. Set-ItemProperty $Cortana3 HarvestContacts -Value 1
  378. Write-Host "Cortana has been enabled!"
  379. }
  380. EnableCortana
  381. })
  382. $UnpinStartMenuTiles.Add_Click( {
  383. Function UnpinStartMenuTiles {
  384. #https://superuser.com/questions/1068382/how-to-remove-all-the-tiles-in-the-windows-10-start-menu
  385. #Unpins all tiles from the Start Menu
  386. Write-Host "Unpinning all tiles from the start menu"
  387. (New-Object -Com Shell.Application).
  388. NameSpace('shell:::{4234d49b-0245-4df3-b780-3893943456e1}').
  389. Items() |
  390. %{ $_.Verbs() } |
  391. ?{$_.Name -match 'Un.*pin from Start'} |
  392. %{$_.DoIt()}
  393. }
  394. UnpinStartMenuTiles
  395. })
  396. $listBox.SelectionMode = 'MultiExtended'
  397. [void] $listBox.Items.Add('Microsoft.BingNews')
  398. [void] $listBox.Items.Add('Microsoft.GetHelp')
  399. [void] $listBox.Items.Add('Microsoft.Getstarted')
  400. [void] $listBox.Items.Add('Microsoft.Messaging')
  401. [void] $listBox.Items.Add('Microsoft.Microsoft3DViewer')
  402. [void] $listBox.Items.Add('Microsoft.MicrosoftOfficeHub')
  403. [void] $listBox.Items.Add('Microsoft.MicrosoftSolitaireCollection')
  404. [void] $listBox.Items.Add('Microsoft.NetworkSpeedTest')
  405. [void] $listBox.Items.Add('Microsoft.News')
  406. [void] $listBox.Items.Add('Microsoft.Office.Lens')
  407. [void] $listBox.Items.Add('Microsoft.Office.OneNote')
  408. [void] $listBox.Items.Add('Microsoft.Office.Sway')
  409. [void] $listBox.Items.Add('Microsoft.OneConnect')
  410. [void] $listBox.Items.Add('Microsoft.People')
  411. [void] $listBox.Items.Add('Microsoft.Print3D')
  412. [void] $listBox.Items.Add('Microsoft.RemoteDesktop')
  413. [void] $listBox.Items.Add('Microsoft.SkypeApp')
  414. [void] $listBox.Items.Add('Microsoft.StorePurchaseApp')
  415. [void] $listBox.Items.Add('Microsoft.Office.Todo.List')
  416. [void] $listBox.Items.Add('Microsoft.Whiteboard')
  417. [void] $listBox.Items.Add('Microsoft.WindowsAlarms')
  418. [void] $listBox.Items.Add('Microsoft.WindowsCamera')
  419. [void] $listBox.Items.Add('microsoft.windowscommunicationsapps')
  420. [void] $listBox.Items.Add('Microsoft.WindowsFeedbackHub')
  421. [void] $listBox.Items.Add('Microsoft.WindowsMaps')
  422. [void] $listBox.Items.Add('Microsoft.WindowsSoundRecorder')
  423. [void] $listBox.Items.Add('Microsoft.Xbox.TCUI')
  424. [void] $listBox.Items.Add('Microsoft.XboxApp')
  425. [void] $listBox.Items.Add('Microsoft.XboxGameOverlay')
  426. [void] $listBox.Items.Add('Microsoft.XboxIdentityProvider')
  427. [void] $listBox.Items.Add('Microsoft.XboxSpeechToTextOverlay')
  428. [void] $listBox.Items.Add('Microsoft.ZuneMusic')
  429. [void] $listBox.Items.Add('Microsoft.ZuneVideo')
  430. [void] $listBox.Items.Add('*EclipseManager*')
  431. [void] $listBox.Items.Add('*ActiproSoftwareLLC*')
  432. [void] $listBox.Items.Add('*AdobeSystemsIncorporated.AdobePhotoshopExpress*')
  433. [void] $listBox.Items.Add('*Duolingo-LearnLanguagesforFree*')
  434. [void] $listBox.Items.Add('*PandoraMediaInc*')
  435. [void] $listBox.Items.Add('*CandyCrush*')
  436. [void] $listBox.Items.Add('*Wunderlist*')
  437. [void] $listBox.Items.Add('*Flipboard*')
  438. [void] $listBox.Items.Add('*Twitter*')
  439. [void] $listBox.Items.Add('*Facebook*')
  440. [void] $listBox.Items.Add('*Spotify*')
  441. [void] $listBox.Items.Add('*Minecraft*')
  442. [void] $listBox.Items.Add('*Royal Revolt*')
  443. [void] $listBox.Items.Add('*Sway*')
  444. [void] $listBox.Items.Add('*Speed Test*')
  445. [void] $listBox.Items.Add('*Dolby*')
  446. [void] $listBox.Items.Add('*Microsoft.Advertising.Xaml_10.1712.5.0_x64__8wekyb3d8bbwe*')
  447. [void] $listBox.Items.Add('*Microsoft.Advertising.Xaml_10.1712.5.0_x86__8wekyb3d8bbwe*')
  448. [void] $listBox.Items.Add('*Microsoft.BingWeather*')
  449. [void] $listBox.Items.Add('*Microsoft.MSPaint*')
  450. [void] $listBox.Items.Add('*Microsoft.MicrosoftStickyNotes*')
  451. [void] $listBox.Items.Add('*Microsoft.Windows.Photos*')
  452. [void] $listBox.Items.Add('*Microsoft.WindowsCalculator*')
  453. [void] $listBox.Items.Add('*Microsoft.WindowsStore*')
  454. $form.Controls.Add($listBox)
  455. $form.Topmost = $true
  456. $result = $form.ShowDialog()
  457. if ($result -eq [System.Windows.Forms.DialogResult]::OK)
  458. {
  459. $x = $listBox.SelectedItems
  460. foreach ($x in $x) {
  461. Get-AppxPackage -Name $x| Remove-AppxPackage
  462. Get-AppxProvisionedPackage -Online | Where-Object DisplayName -like $x | Remove-AppxProvisionedPackage -Online
  463. Write-Verbose "Trying to remove $x."
  464. }
  465. }