2019-11-18 11:51:12 +00:00
<#
$EnableEdgePDFTakeover . Text = " Enable Edge PDF Takeover "
$EnableEdgePDFTakeover . Width = 185
$EnableEdgePDFTakeover . Height = 35
$EnableEdgePDFTakeover . Location = New-Object System . Drawing . Point ( 155 , 260 )
#>
2019-01-26 04:23:12 +00:00
#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.
2019-06-10 05:37:21 +00:00
2019-11-18 11:37:00 +00:00
$ErrorActionPreference = 'SilentlyContinue'
2019-06-10 05:37:21 +00:00
2019-11-18 11:51:12 +00:00
$Button = [ System.Windows.MessageBoxButton ] :: YesNoCancel
$ErrorIco = [ System.Windows.MessageBoxImage ] :: Error
2019-06-10 05:37:21 +00:00
$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 . '
2019-02-28 04:39:11 +00:00
If ( ! ( [ Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity ] :: GetCurrent ( ) ) . IsInRole ( [ Security.Principal.WindowsBuiltInRole ] 'Administrator' ) ) {
2019-11-18 11:51:12 +00:00
$Prompt = [ System.Windows.MessageBox ] :: Show ( $Ask , " Run as an Administrator or not? " , $Button , $ErrorIco )
2019-06-10 05:37:21 +00:00
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. "
2019-11-18 11:51:12 +00:00
Start-Process PowerShell . exe -ArgumentList ( " -NoProfile -ExecutionPolicy Bypass -File `" {0} `" " -f $PSCommandPath ) -Verb RunAs
2019-06-10 05:37:21 +00:00
Exit
}
No {
Break
}
}
2019-02-23 22:28:00 +00:00
}
2019-01-26 04:22:42 +00:00
2019-05-29 11:38:38 +00:00
#Unnecessary Windows 10 AppX apps that will be removed by the blacklist.
$global:Bloatware = @ (
2020-04-28 08:24:09 +00:00
" Microsoft.PPIProjection "
2019-05-29 11:38:38 +00:00
" 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 "
2019-05-30 11:23:01 +00:00
" Microsoft.XboxGamingOverlay "
2019-05-29 11:38:38 +00:00
" 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 "
2020-03-15 00:53:27 +00:00
" BubbleWitch3Saga "
2019-05-29 11:38:38 +00:00
" 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
2019-05-30 11:23:01 +00:00
" Microsoft.XboxApp "
" Microsoft.XboxGameOverlay "
" Microsoft.XboxGamingOverlay " # Issue 25, 91 Many home users want to play games
2019-05-29 11:38:38 +00:00
" Microsoft.XboxIdentityProvider " # Issue 25, 91 Many home users want to play games
2019-05-30 11:23:01 +00:00
" Microsoft.XboxSpeechToTextOverlay "
2019-05-29 11:38:38 +00:00
" 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
2019-11-28 18:39:27 +00:00
" *Nvidia* " # Issue 198
2019-11-28 18:41:45 +00:00
" Microsoft.MixedReality.Portal " # Issue 195
2019-05-29 11:38:38 +00:00
)
#NonRemovable Apps that where getting attempted and the system would reject the uninstall, speeds up debloat and prevents 'initalizing' overlay when removing apps
2019-11-18 11:51:12 +00:00
$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
2019-05-29 11:38:38 +00:00
2019-06-10 05:37:21 +00:00
if ( $NonRemovables -eq $null ) {
# the .NonRemovable property doesn't exist until version 18xx. Use a hard-coded list instead.
2019-05-29 11:38:38 +00:00
#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 "
2019-05-29 18:45:59 +00:00
" Microsoft.Windows.HolographicFirstRun " # Added 1709
2019-05-29 11:38:38 +00:00
" Microsoft.Windows.NarratorQuickStart "
2019-05-29 18:45:59 +00:00
" Microsoft.Windows.OOBENetworkCaptivePortal " # Added 1709
" Microsoft.Windows.OOBENetworkConnectionFlow " # Added 1709
2019-05-29 11:38:38 +00:00
" Microsoft.Windows.ParentalControls "
" Microsoft.Windows.PeopleExperienceHost "
" Microsoft.Windows.PinningConfirmationDialog "
" Microsoft.Windows.SecHealthUI " # Issue 117 Windows Defender
2019-05-29 18:45:59 +00:00
" Microsoft.Windows.SecondaryTileExperience " # Added 1709
2019-05-29 11:38:38 +00:00
" 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 )
}
2019-06-10 05:37:21 +00:00
if ( test-path $scriptPath \ $includeFile ) {
2019-05-29 11:38:38 +00:00
# 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
2019-05-29 18:00:03 +00:00
$global:BloatwareRegex = $global:Bloatware -join '|'
2019-05-29 11:38:38 +00:00
$global:WhiteListedAppsRegex = $global:WhiteListedApps -join '|'
2019-02-28 04:39:11 +00:00
# This form was created using POSHGUI.com a free online gui designer for PowerShell
2018-10-28 19:22:51 +00:00
Add-Type -AssemblyName System . Windows . Forms
[ System.Windows.Forms.Application ] :: EnableVisualStyles ( )
2019-02-28 04:39:11 +00:00
#region begin GUI
2019-11-18 11:51:12 +00:00
$Form = New-Object System . Windows . Forms . Form
2019-06-10 05:05:08 +00:00
$Form . ClientSize = '800,500'
2019-11-18 11:51:12 +00:00
$Form . Text = " Windows10Debloater "
2018-10-28 19:22:51 +00:00
$Form . TopMost = $false
2019-11-18 11:51:12 +00:00
$Debloat = New-Object System . Windows . Forms . Label
$Debloat . Text = " Debloat Options "
2018-10-28 19:22:51 +00:00
$Debloat . AutoSize = $true
2019-11-18 11:51:12 +00:00
$Debloat . Width = 25
$Debloat . Height = 10
$Debloat . Location = New-Object System . Drawing . Point ( 9 , 8 )
2018-10-28 19:22:51 +00:00
$Debloat . Font = 'Microsoft Sans Serif,12,style=Bold,Underline'
2019-05-29 18:00:03 +00:00
2019-11-18 11:51:12 +00:00
$CustomizeBlacklists = New-Object System . Windows . Forms . Button
$CustomizeBlacklists . Text = " Customize Blacklist "
$CustomizeBlacklists . Width = 140
$CustomizeBlacklists . Height = 40
$CustomizeBlacklists . Location = New-Object System . Drawing . Point ( 9 , 32 )
2019-05-29 18:00:03 +00:00
$CustomizeBlacklists . Font = 'Microsoft Sans Serif,10'
2019-11-18 11:51:12 +00:00
$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 , 79 )
2018-10-28 19:22:51 +00:00
$RemoveAllBloatware . Font = 'Microsoft Sans Serif,10'
2019-11-18 11:51:12 +00:00
$RemoveBlacklist = New-Object System . Windows . Forms . Button
$RemoveBlacklist . Text = " Remove Bloatware With Customized Blacklist "
$RemoveBlacklist . Width = 205
$RemoveBlacklist . Height = 37
$RemoveBlacklist . Location = New-Object System . Drawing . Point ( 9 , 124 )
2018-10-28 19:22:51 +00:00
$RemoveBlacklist . Font = 'Microsoft Sans Serif,10'
2019-11-18 11:51:12 +00:00
$Label1 = New-Object System . Windows . Forms . Label
$Label1 . Text = " Revert Registry Changes "
2018-10-28 19:22:51 +00:00
$Label1 . AutoSize = $true
2019-11-18 11:51:12 +00:00
$Label1 . Width = 25
$Label1 . Height = 10
$Label1 . Location = New-Object System . Drawing . Point ( 254 , 7 )
2018-10-28 19:22:51 +00:00
$Label1 . Font = 'Microsoft Sans Serif,12,style=Bold,Underline'
2019-11-18 11:51:12 +00:00
$RevertChange = New-Object System . Windows . Forms . Button
$RevertChange . Text = " Revert Registry Changes "
$RevertChange . Width = 113
$RevertChange . Height = 36
$RevertChange . Location = New-Object System . Drawing . Point ( 254 , 32 )
2018-10-28 19:22:51 +00:00
$RevertChange . Font = 'Microsoft Sans Serif,10'
2019-11-18 11:51:12 +00:00
$Label2 = New-Object System . Windows . Forms . Label
$Label2 . Text = " Optional Changes/Fixes "
2018-10-28 19:22:51 +00:00
$Label2 . AutoSize = $true
2019-11-18 11:51:12 +00:00
$Label2 . Width = 25
$Label2 . Height = 10
$Label2 . Location = New-Object System . Drawing . Point ( 9 , 193 )
2018-10-28 19:22:51 +00:00
$Label2 . Font = 'Microsoft Sans Serif,12,style=Bold,Underline'
2019-11-18 11:51:12 +00:00
$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 )
2018-10-28 19:22:51 +00:00
$DisableCortana . Font = 'Microsoft Sans Serif,10'
2019-11-18 11:51:12 +00:00
$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 )
2018-10-28 19:22:51 +00:00
$EnableCortana . Font = 'Microsoft Sans Serif,10'
2019-11-18 11:51:12 +00:00
$StopEdgePDFTakeover = New-Object System . Windows . Forms . Button
$StopEdgePDFTakeover . Text = " Stop Edge PDF Takeover "
$StopEdgePDFTakeover . Width = 175
$StopEdgePDFTakeover . Height = 35
$StopEdgePDFTakeover . Location = New-Object System . Drawing . Point ( 155 , 217 )
2018-10-28 19:22:51 +00:00
$StopEdgePDFTakeover . Font = 'Microsoft Sans Serif,10'
2019-11-18 11:51:12 +00:00
$EnableEdgePDFTakeover = New-Object System . Windows . Forms . Button
$EnableEdgePDFTakeover . Text = " Enable Edge PDF Takeover "
$EnableEdgePDFTakeover . Width = 185
$EnableEdgePDFTakeover . Height = 35
$EnableEdgePDFTakeover . Location = New-Object System . Drawing . Point ( 155 , 260 )
2018-10-28 19:22:51 +00:00
$EnableEdgePDFTakeover . Font = 'Microsoft Sans Serif,10'
2019-11-18 11:51:12 +00:00
$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 ( 365 , 260 )
2018-10-28 19:22:51 +00:00
$DisableTelemetry . Font = 'Microsoft Sans Serif,10'
2019-11-18 11:51:12 +00:00
$RemoveRegkeys = New-Object System . Windows . Forms . Button
$RemoveRegkeys . Text = " Remove Bloatware Regkeys "
$RemoveRegkeys . Width = 188
$RemoveRegkeys . Height = 35
$RemoveRegkeys . Location = New-Object System . Drawing . Point ( 540 , 260 )
2018-10-28 19:22:51 +00:00
$RemoveRegkeys . Font = 'Microsoft Sans Serif,10'
2019-11-18 11:51:12 +00:00
$UnpinStartMenuTiles = New-Object System . Windows . Forms . Button
$UnpinStartMenuTiles . Text = " Unpin Tiles From Start Menu "
$UnpinStartMenuTiles . Width = 190
$UnpinStartMenuTiles . Height = 35
$UnpinStartMenuTiles . Location = New-Object System . Drawing . Point ( 540 , 217 )
2019-02-17 04:05:01 +00:00
$UnpinStartMenuTiles . Font = 'Microsoft Sans Serif,10'
2019-11-18 11:51:12 +00:00
$RemoveOnedrive = New-Object System . Windows . Forms . Button
$RemoveOnedrive . Text = " Uninstall OneDrive "
$RemoveOnedrive . Width = 152
$RemoveOnedrive . Height = 35
$RemoveOnedrive . Location = New-Object System . Drawing . Point ( 365 , 217 )
2018-10-28 19:22:51 +00:00
$RemoveOnedrive . Font = 'Microsoft Sans Serif,10'
2019-11-18 11:51:12 +00:00
#$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)
2019-06-10 05:05:08 +00:00
#$FixWhitelist.Font = 'Microsoft Sans Serif,10'
2018-10-28 19:22:51 +00:00
2019-11-18 11:51:12 +00:00
$InstallNet35 = New-Object System . Windows . Forms . Button
$InstallNet35 . Text = " Install .NET v3.5 "
$InstallNet35 . Width = 152
$InstallNet35 . Height = 39
$InstallNet35 . Location = New-Object System . Drawing . Point ( 169 , 335 )
2019-02-26 03:33:50 +00:00
$InstallNet35 . Font = 'Microsoft Sans Serif,10'
2019-11-18 11:51:12 +00:00
$EnableDarkMode = New-Object System . Windows . Forms . Button
$EnableDarkMode . Text = " Enable Dark Mode "
$EnableDarkMode . Width = 152
$EnableDarkMode . Height = 39
$EnableDarkMode . Location = New-Object System . Drawing . Point ( 9 , 335 )
2019-03-05 06:07:40 +00:00
$EnableDarkMode . Font = 'Microsoft Sans Serif,10'
2019-11-18 11:51:12 +00:00
$DisableDarkMode = New-Object System . Windows . Forms . Button
$DisableDarkMode . Text = " Disable Dark Mode "
$DisableDarkMode . Width = 152
$DisableDarkMode . Height = 39
$DisableDarkMode . Location = New-Object System . Drawing . Point ( 9 , 385 )
2019-03-05 06:07:40 +00:00
$DisableDarkMode . Font = 'Microsoft Sans Serif,10'
2019-02-26 03:33:50 +00:00
2019-05-29 18:00:03 +00:00
$Form . controls . AddRange ( @ ( $Debloat , $CustomizeBlacklists , $RemoveAllBloatware , $RemoveBlacklist , $Label1 , $RevertChange , $Label2 , $DisableCortana , $EnableCortana , $StopEdgePDFTakeover , $EnableEdgePDFTakeover , $DisableTelemetry , $RemoveRegkeys , $UnpinStartMenuTiles , $RemoveOnedrive , $FixWhitelist , $RemoveBloatNoBlacklist , $InstallNet35 , $EnableDarkMode , $DisableDarkMode ) )
2018-10-28 19:22:51 +00:00
2018-12-23 23:07:33 +00:00
$DebloatFolder = " C:\Temp\Windows10Debloater "
If ( Test-Path $DebloatFolder ) {
2019-11-18 11:51:12 +00:00
Write-Host " ${DebloatFolder} exists. Skipping. "
2018-12-23 23:07:33 +00:00
}
Else {
2019-11-18 11:51:12 +00:00
Write-Host " The folder ${DebloatFolder} doesn't exist. This folder will be used for storing logs created after the script runs. Creating now. "
2018-12-23 23:07:33 +00:00
Start-Sleep 1
2019-11-18 11:51:12 +00:00
New-Item -Path " ${DebloatFolder} " -ItemType Directory
Write-Host " The folder ${DebloatFolder} was successfully created. "
2018-12-23 23:07:33 +00:00
}
2019-11-18 11:51:12 +00:00
Start-Transcript -OutputDirectory " ${DebloatFolder} "
2018-12-23 23:12:12 +00:00
2018-10-28 19:22:51 +00:00
#region gui events {
2019-05-29 18:00:03 +00:00
$CustomizeBlacklists . Add_Click ( {
2019-11-18 11:51:12 +00:00
$CustomizeForm = New-Object System . Windows . Forms . Form
2019-06-10 05:37:21 +00:00
$CustomizeForm . ClientSize = '600,400'
2019-11-18 11:51:12 +00:00
$CustomizeForm . Text = " Customize Whitelist and Blacklist "
2019-06-10 05:37:21 +00:00
$CustomizeForm . TopMost = $false
$CustomizeForm . AutoScroll = $true
2019-11-18 11:51:12 +00:00
$SaveList = New-Object System . Windows . Forms . Button
$SaveList . Text = " Save custom Whitelist and Blacklist to custom-lists.ps1 "
2019-06-10 05:37:21 +00:00
$SaveList . AutoSize = $true
2019-11-18 11:51:12 +00:00
$SaveList . Location = New-Object System . Drawing . Point ( 200 , 5 )
2019-06-10 05:37:21 +00:00
$CustomizeForm . controls . Add ( $SaveList )
$SaveList . Add_Click ( {
2019-11-18 11:51:12 +00:00
$ErrorActionPreference = 'SilentlyContinue'
2019-06-10 05:37:21 +00:00
'$global:WhiteListedApps = @(' | Out-File -FilePath $PSScriptRoot \ custom-lists . ps1 -Encoding utf8
@ ( $CustomizeForm . 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
2019-05-29 18:00:03 +00:00
2019-06-10 05:37:21 +00:00
'$global:Bloatware = @(' | Out-File -FilePath $PSScriptRoot \ custom-lists . ps1 -Append -Encoding utf8
@ ( $CustomizeForm . 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 ,
[ string ] $notes
)
2019-05-29 18:00:03 +00:00
2019-11-18 11:51:12 +00:00
$label = New-Object System . Windows . Forms . Label
2019-06-10 05:37:21 +00:00
$label . Location = New-Object System . Drawing . Point ( 2 , ( 30 + $position * 16 ) )
$label . Text = $notes
2019-11-18 11:51:12 +00:00
$label . Width = 300
$label . Height = 16
2019-06-10 05:37:21 +00:00
$Label . TextAlign = [ System.Drawing.ContentAlignment ] :: TopRight
$CustomizeForm . controls . Add ( $label )
2019-11-18 11:51:12 +00:00
$Checkbox = New-Object System . Windows . Forms . CheckBox
$Checkbox . Text = $appName
$Checkbox . Location = New-Object System . Drawing . Point ( 320 , ( 30 + $position * 16 ) )
2019-06-10 05:37:21 +00:00
$Checkbox . Autosize = 1 ;
$Checkbox . Checked = $checked
$Checkbox . Enabled = $enabled
$CustomizeForm . controls . Add ( $CheckBox )
}
2019-05-29 18:00:03 +00:00
2019-06-10 05:37:21 +00:00
$Installed = @ ( ( Get-AppxPackage ) . Name )
$Online = @ ( ( Get-AppxProvisionedPackage -Online ) . DisplayName )
$AllUsers = @ ( ( Get-AppxPackage -AllUsers ) . Name )
[ int ] $checkboxCounter = 0
2019-11-18 11:51:12 +00:00
ForEach ( $item in $NonRemovables ) {
2019-06-10 05:37:21 +00:00
$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 + = " NONREMOVABLE "
AddAppToCustomizeForm $checkboxCounter $item $false $false $string
+ + $checkboxCounter
}
2019-11-18 11:51:12 +00:00
ForEach ( $item in $global:WhiteListedApps ) {
2019-06-10 05:37:21 +00:00
$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 $string
+ + $checkboxCounter
}
2019-11-18 11:51:12 +00:00
ForEach ( $item in $global:Bloatware ) {
2019-06-10 05:37:21 +00:00
$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 $string
+ + $checkboxCounter
}
2019-11-18 11:51:12 +00:00
ForEach ( $item in $AllUsers ) {
2019-06-10 05:37:21 +00:00
$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 $string
+ + $checkboxCounter
}
2019-11-18 11:51:12 +00:00
ForEach ( $item in $Installed ) {
2019-06-10 05:37:21 +00:00
$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 $string
+ + $checkboxCounter
}
2019-11-18 11:51:12 +00:00
ForEach ( $item in $Online ) {
2019-06-10 05:37:21 +00:00
$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 $string
+ + $checkboxCounter
}
[ void ] $CustomizeForm . ShowDialog ( )
2019-05-29 18:00:03 +00:00
2019-06-10 05:37:21 +00:00
} )
2019-05-29 18:00:03 +00:00
2018-10-28 19:22:51 +00:00
$RemoveBlacklist . Add_Click ( {
2019-11-18 11:51:12 +00:00
$ErrorActionPreference = 'SilentlyContinue'
2018-10-28 19:22:51 +00:00
Function DebloatBlacklist {
2019-05-30 06:36:59 +00:00
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
2018-10-28 19:22:51 +00:00
}
2019-05-30 06:36:59 +00:00
Write-Host " `n `n `n `n `n `n `n `n `n `n `n `n `n `n `n `n `n Removing blacklisted Bloatware. `n "
2018-10-28 19:22:51 +00:00
DebloatBlacklist
2019-05-29 11:38:38 +00:00
Write-Host " Bloatware removed! "
2018-10-28 19:22:51 +00:00
} )
$RemoveAllBloatware . Add_Click ( {
2019-11-18 11:51:12 +00:00
$ErrorActionPreference = 'SilentlyContinue'
2018-10-28 19:22:51 +00:00
#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 {
2019-02-28 04:39:11 +00:00
Write-Host " Starting Sysprep Fixes "
2018-10-28 19:22:51 +00:00
# Disable Windows Store Automatic Updates
2019-02-28 04:39:11 +00:00
Write-Host " Adding Registry key to Disable Windows Store Automatic Updates "
2018-10-28 19:22:51 +00:00
$registryPath = " HKLM:\SOFTWARE\Policies\Microsoft\WindowsStore "
If ( ! ( Test-Path $registryPath ) ) {
2019-02-28 04:39:11 +00:00
Mkdir $registryPath
New-ItemProperty $registryPath AutoDownload -Value 2
2018-10-28 19:22:51 +00:00
}
2019-02-28 04:39:11 +00:00
Set-ItemProperty $registryPath AutoDownload -Value 2
2018-10-28 19:22:51 +00:00
#Stop WindowsStore Installer Service and set to Disabled
2019-02-28 04:39:11 +00:00
Write-Host " Stopping InstallService "
2018-10-28 19:22:51 +00:00
Stop-Service InstallService
2019-02-28 04:39:11 +00:00
Write-Host " Setting InstallService Startup to Disabled "
Set-Service InstallService -StartupType Disabled
2018-10-28 19:22:51 +00:00
}
2018-12-23 23:07:33 +00:00
Function CheckDMWService {
2018-12-23 23:35:10 +00:00
Param ( [ switch ] $Debloat )
2018-12-23 23:07:33 +00:00
2019-06-10 05:37:21 +00:00
If ( Get-Service dmwappushservice | Where-Object { $_ . StartType -eq " Disabled " } ) {
2019-02-28 04:39:11 +00:00
Set-Service dmwappushservice -StartupType Automatic
2018-12-23 23:35:10 +00:00
}
2018-12-23 23:07:33 +00:00
2019-06-10 05:37:21 +00:00
If ( Get-Service dmwappushservice | Where-Object { $_ . Status -eq " Stopped " } ) {
2019-02-28 04:39:11 +00:00
Start-Service dmwappushservice
2018-12-23 23:35:10 +00:00
}
}
2018-12-23 23:12:12 +00:00
2018-10-28 19:22:51 +00:00
Function DebloatAll {
#Removes AppxPackages
2019-05-29 11:38:38 +00:00
Get-AppxPackage | Where { ! ( $_ . Name -cmatch $global:WhiteListedAppsRegex ) -and ! ( $NonRemovables -cmatch $_ . Name ) } | Remove-AppxPackage
2019-05-30 10:55:31 +00:00
Get-AppxProvisionedPackage -Online | Where { ! ( $_ . DisplayName -cmatch $global:WhiteListedAppsRegex ) -and ! ( $NonRemovables -cmatch $_ . DisplayName ) } | Remove-AppxProvisionedPackage -Online
2019-05-30 11:15:01 +00:00
Get-AppxPackage -AllUsers | Where { ! ( $_ . Name -cmatch $global:WhiteListedAppsRegex ) -and ! ( $NonRemovables -cmatch $_ . Name ) } | Remove-AppxPackage
2019-06-10 05:37:21 +00:00
}
2018-10-28 19:22:51 +00:00
#Creates a PSDrive to be able to access the 'HKCR' tree
New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT
2019-02-28 04:39:11 +00:00
Function Remove-Keys {
2018-10-28 19:22:51 +00:00
#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 "
2019-02-28 04:39:11 +00:00
Remove-Item $Key -Recurse
2018-10-28 19:22:51 +00:00
}
}
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 ) {
2019-02-28 04:39:11 +00:00
Set-ItemProperty $Advertising Enabled -Value 0
2018-10-28 19:22:51 +00:00
}
#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 ) {
2019-02-28 04:39:11 +00:00
Set-ItemProperty $Search AllowCortana -Value 0
2018-10-28 19:22:51 +00:00
}
#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 ) ) {
2019-02-28 04:39:11 +00:00
mkdir $Period1
mkdir $Period2
mkdir $Period3
New-ItemProperty $Period3 PeriodInNanoSeconds -Value 0
2018-10-28 19:22:51 +00:00
}
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 ) ) {
2019-02-28 04:39:11 +00:00
Mkdir $registryPath
New-ItemProperty $registryPath DisableWindowsConsumerFeatures -Value 1
2018-10-28 19:22:51 +00:00
}
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 ) {
2019-02-28 04:39:11 +00:00
Set-ItemProperty $Holo FirstRunSucceeded -Value 0
2018-10-28 19:22:51 +00:00
}
#Disables live tiles
Write-Host " Disabling live tiles "
$Live = 'HKCU:\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\PushNotifications'
If ( ! ( Test-Path $Live ) ) {
2019-02-28 04:39:11 +00:00
mkdir $Live
New-ItemProperty $Live NoTileApplicationNotification -Value 1
2018-10-28 19:22:51 +00:00
}
#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 ) {
2019-02-28 04:39:11 +00:00
Set-ItemProperty $DataCollection AllowTelemetry -Value 0
2018-10-28 19:22:51 +00:00
}
#Disables People icon on Taskbar
Write-Host " Disabling People icon on Taskbar "
2019-01-26 04:00:34 +00:00
$People = 'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People'
If ( Test-Path $People ) {
2019-02-28 04:39:11 +00:00
Set-ItemProperty $People PeopleBand -Value 0
2018-10-28 19:22:51 +00:00
}
#Disables suggestions on start menu
Write-Host " Disabling suggestions on the Start Menu "
$Suggestions = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager'
If ( Test-Path $Suggestions ) {
2019-02-28 04:39:11 +00:00
Set-ItemProperty $Suggestions SystemPaneSuggestionsEnabled -Value 0
2018-10-28 19:22:51 +00:00
}
2018-12-01 19:07:49 +00:00
2019-02-28 04:39:11 +00:00
Write-Host " Removing CloudStore from registry if it exists "
2020-03-15 00:53:27 +00:00
$CloudStore = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\CloudStore'
2018-12-01 19:07:49 +00:00
If ( Test-Path $CloudStore ) {
2018-12-23 23:35:10 +00:00
Stop-Process Explorer . exe -Force
2020-03-15 00:53:27 +00:00
Remove-Item $CloudStore -Recurse -Force
2018-12-23 23:35:10 +00:00
Start-Process Explorer . exe -Wait
2018-12-01 19:07:49 +00:00
}
2018-10-28 19:22:51 +00:00
#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 "
2019-02-28 04:39:11 +00:00
#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
2018-10-28 19:22:51 +00:00
}
2019-02-17 04:05:01 +00:00
2019-02-28 04:39:11 +00:00
Function UnpinStart {
2021-02-05 17:11:31 +00:00
# https://superuser.com/a/1442733
# Requires -RunAsAdministrator
$START_MENU_LAYOUT = @"
< LayoutModificationTemplate xmlns : defaultlayout = " http://schemas.microsoft.com/Start/2014/FullDefaultLayout " xmlns : start = " http://schemas.microsoft.com/Start/2014/StartLayout " Version = " 1 " xmlns : taskbar = " http://schemas.microsoft.com/Start/2014/TaskbarLayout " xmlns = " http://schemas.microsoft.com/Start/2014/LayoutModification " >
< LayoutOptions StartTileGroupCellWidth = " 6 " / >
< DefaultLayoutOverride >
< StartLayoutCollection >
< defaultlayout : StartLayout GroupCellWidth = " 6 " / >
< / StartLayoutCollection >
< / DefaultLayoutOverride >
< / LayoutModificationTemplate >
" @
$layoutFile = " C:\Windows\StartMenuLayout.xml "
#Delete layout file if it already exists
If ( Test-Path $layoutFile )
{
Remove-Item $layoutFile
}
#Creates the blank layout file
$START_MENU_LAYOUT | Out-File $layoutFile -Encoding ASCII
2019-02-28 04:39:11 +00:00
2021-02-05 17:11:31 +00:00
$regAliases = @ ( " HKLM " , " HKCU " )
#Assign the start layout and force it to apply with "LockedStartLayout" at both the machine and user level
foreach ( $regAlias in $regAliases ) {
$basePath = $regAlias + " :\SOFTWARE\Policies\Microsoft\Windows "
$keyPath = $basePath + " \Explorer "
IF ( ! ( Test-Path -Path $keyPath ) ) {
New-Item -Path $basePath -Name " Explorer "
}
Set-ItemProperty -Path $keyPath -Name " LockedStartLayout " -Value 1
Set-ItemProperty -Path $keyPath -Name " StartLayoutFile " -Value $layoutFile
2019-02-28 04:39:11 +00:00
}
2021-02-05 17:11:31 +00:00
#Restart Explorer, open the start menu (necessary to load the new layout), and give it a few seconds to process
Stop-Process -name explorer
Start-Sleep -s 5
$wshell = New-Object -ComObject wscript . shell ; $wshell . SendKeys ( '^{ESCAPE}' )
Start-Sleep -s 5
#Enable the ability to pin items again by disabling "LockedStartLayout"
foreach ( $regAlias in $regAliases ) {
$basePath = $regAlias + " :\SOFTWARE\Policies\Microsoft\Windows "
$keyPath = $basePath + " \Explorer "
Set-ItemProperty -Path $keyPath -Name " LockedStartLayout " -Value 0
2019-02-28 04:39:11 +00:00
}
2019-06-10 05:05:08 +00:00
2021-02-05 17:11:31 +00:00
#Restart Explorer and delete the layout file
Stop-Process -name explorer
2018-12-23 23:07:33 +00:00
2021-02-05 17:11:31 +00:00
# Uncomment the next line to make clean start menu default for all new users
#Import-StartLayout -LayoutPath $layoutFile -MountPath $env:SystemDrive\
2018-12-23 23:07:33 +00:00
2021-02-05 17:11:31 +00:00
Remove-Item $layoutFile
2018-12-23 23:12:12 +00:00
}
2018-11-10 00:46:38 +00:00
Function CheckInstallService {
2019-06-10 05:37:21 +00:00
If ( Get-Service InstallService | Where-Object { $_ . Status -eq " Stopped " } ) {
2019-02-28 04:39:11 +00:00
Start-Service InstallService
Set-Service InstallService -StartupType Automatic
2018-11-12 06:51:10 +00:00
}
}
2018-10-28 19:22:51 +00:00
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
2019-02-17 04:05:01 +00:00
Write-Host " Unpinning tiles from the Start Menu. "
2019-02-28 04:39:11 +00:00
UnpinStart
Write-Host " Setting the 'InstallService' Windows service back to 'Started' and the Startup Type 'Automatic'. "
2018-11-11 03:31:37 +00:00
CheckDMWService
2018-11-10 00:46:38 +00:00
CheckInstallService
2018-10-28 19:22:51 +00:00
Write-Host " Finished all tasks. `n "
} )
$RevertChange . Add_Click ( {
2019-11-18 11:51:12 +00:00
$ErrorActionPreference = 'SilentlyContinue'
2018-10-28 19:22:51 +00:00
#This function will revert the changes you made when running the Start-Debloat function.
#This line reinstalls all of the bloatware that was removed
2019-06-10 05:37:21 +00:00
Get-AppxPackage -AllUsers | ForEach { Add-AppxPackage -Verbose -DisableDevelopmentMode -Register " $( $_ . InstallLocation ) \AppXManifest.xml " }
2018-10-28 19:22:51 +00:00
#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
2019-01-26 04:00:34 +00:00
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
2018-10-28 19:22:51 +00:00
}
#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 "
2019-02-28 04:39:11 +00:00
Write-Host " Done reverting changes! "
#
2019-11-18 11:51:12 +00:00
Write-Output " Restoring 3D Objects from Explorer 'My Computer' submenu "
2019-02-28 04:39:11 +00:00
$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
}
2018-10-28 19:22:51 +00:00
} )
$DisableCortana . Add_Click ( {
2019-11-18 11:51:12 +00:00
$ErrorActionPreference = 'SilentlyContinue'
2018-10-28 19:22:51 +00:00
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
2019-02-28 04:39:11 +00:00
Write-Host " Cortana has been disabled. "
2018-10-28 19:22:51 +00:00
} )
$StopEdgePDFTakeover . Add_Click ( {
2019-11-18 11:51:12 +00:00
$ErrorActionPreference = 'SilentlyContinue'
2018-10-28 19:22:51 +00:00
#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_
}
2019-02-28 04:39:11 +00:00
Write-Host " Edge should no longer take over as the default .PDF. "
2018-10-28 19:22:51 +00:00
} )
$EnableCortana . Add_Click ( {
2019-11-18 11:51:12 +00:00
$ErrorActionPreference = 'SilentlyContinue'
2018-10-28 19:22:51 +00:00
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
2019-02-28 04:39:11 +00:00
Write-Host " Cortana has been enabled! "
2018-10-28 19:22:51 +00:00
} )
$EnableEdgePDFTakeover . Add_Click ( {
New-PSDrive HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT
2019-11-18 11:51:12 +00:00
$ErrorActionPreference = 'SilentlyContinue'
2018-10-28 19:22:51 +00:00
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
}
2019-02-28 04:39:11 +00:00
Write-Host " Edge will now be able to be used for .PDF. "
2018-10-28 19:22:51 +00:00
} )
$DisableTelemetry . Add_Click ( {
2019-11-18 11:51:12 +00:00
$ErrorActionPreference = 'SilentlyContinue'
2018-10-28 19:22:51 +00:00
#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
}
2019-11-18 11:51:12 +00:00
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
2018-10-28 19:22:51 +00:00
#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 "
2019-01-26 04:00:34 +00:00
$People = 'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People'
If ( Test-Path $People ) {
2019-02-28 04:39:11 +00:00
Set-ItemProperty $People -Name PeopleBand -Value 0
2019-01-26 04:00:34 +00:00
}
2018-10-28 19:22:51 +00:00
#Disables scheduled tasks that are considered unnecessary
Write-Host " Disabling scheduled tasks "
2019-11-18 11:51:12 +00:00
#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
2018-10-28 19:22:51 +00:00
#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
2019-02-28 04:39:11 +00:00
Write-Host " Telemetry has been disabled! "
2018-10-28 19:22:51 +00:00
} )
$RemoveRegkeys . Add_Click ( {
2019-11-18 11:51:12 +00:00
$ErrorActionPreference = 'SilentlyContinue'
2018-10-28 19:22:51 +00:00
$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
}
2019-02-28 04:39:11 +00:00
Write-Host " Additional bloatware keys have been removed! "
2018-10-28 19:22:51 +00:00
} )
2019-02-17 04:05:01 +00:00
$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
2019-06-10 05:37:21 +00:00
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 ( ) }
2019-02-17 04:05:01 +00:00
} )
2018-10-28 19:22:51 +00:00
$RemoveOnedrive . Add_Click ( {
2019-02-28 04:39:11 +00:00
If ( Test-Path " $env:USERPROFILE \OneDrive\* " ) {
Write-Host " Files found within the OneDrive folder! Checking to see if a folder named OneDriveBackupFiles exists. "
2018-11-12 06:51:10 +00:00
Start-Sleep 1
2019-02-28 04:39:11 +00:00
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. "
2018-11-12 06:51:10 +00:00
}
else {
2019-02-28 04:39:11 +00:00
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. "
2018-11-12 06:51:10 +00:00
New-item -Path " $env:USERPROFILE \Desktop " -Name " OneDriveBackupFiles " -ItemType Directory -Force
2019-02-28 04:39:11 +00:00
Write-Host " Successfully created the folder 'OneDriveBackupFiles' on your desktop. "
2018-11-12 06:51:10 +00:00
}
}
Start-Sleep 1
Move-Item -Path " $env:USERPROFILE \OneDrive\* " -Destination " $env:USERPROFILE \Desktop\OneDriveBackupFiles " -Force
2019-02-28 04:39:11 +00:00
Write-Host " Successfully moved all files/folders from your OneDrive folder to the folder 'OneDriveBackupFiles' on your desktop. "
2018-11-12 06:51:10 +00:00
Start-Sleep 1
2019-02-28 04:39:11 +00:00
Write-Host " Proceeding with the removal of OneDrive. "
2018-11-12 06:51:10 +00:00
Start-Sleep 1
}
Else {
2019-02-28 04:39:11 +00:00
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
2018-12-23 23:35:10 +00:00
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 ) ) {
2019-02-28 04:39:11 +00:00
Mkdir $OneDriveKey
Set-ItemProperty $OneDriveKey -Name OneDrive -Value DisableFileSyncNGSC
2018-12-23 23:35:10 +00:00
}
2019-02-28 04:39:11 +00:00
Set-ItemProperty $OneDriveKey -Name OneDrive -Value DisableFileSyncNGSC
2018-11-12 06:51:10 +00:00
}
2018-10-28 19:22:51 +00:00
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
2019-02-28 04:39:11 +00:00
taskkill . exe / F / IM explorer . exe
2018-10-28 19:22:51 +00:00
Start-Sleep 3
Write-Host " Removing leftover files "
2019-02-28 04:39:11 +00:00
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
}
2018-10-28 19:22:51 +00:00
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
2019-02-28 04:39:11 +00:00
Write-Host " OneDrive has been successfully uninstalled! "
2019-06-14 02:44:46 +00:00
Remove-item env : OneDrive
2018-10-28 19:22:51 +00:00
} )
2019-02-26 03:33:50 +00:00
$InstallNet35 . Add_Click ( {
Write-Host " Initializing the installation of .NET 3.5... "
2019-02-28 04:39:11 +00:00
DISM / Online / Enable-Feature / FeatureName : NetFx3 / All
Write-Host " .NET 3.5 has been successfully installed! "
2019-02-26 03:33:50 +00:00
} )
2019-06-10 05:37:21 +00:00
$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 "
}
2019-03-05 06:07:40 +00:00
)
2019-06-10 05:37:21 +00:00
$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 "
}
2019-03-05 06:07:40 +00:00
)
2018-10-28 19:22:51 +00:00
[ void ] $Form . ShowDialog ( )