New simple designed UI for a better look !

pull/286/head
tlejolivet 4 years ago
parent cbb7ff8d67
commit 890c318872

@ -210,152 +210,270 @@ $global:WhiteListedAppsRegex = $global:WhiteListedApps -join '|'
Add-Type -AssemblyName System.Windows.Forms Add-Type -AssemblyName System.Windows.Forms
[System.Windows.Forms.Application]::EnableVisualStyles() [System.Windows.Forms.Application]::EnableVisualStyles()
#region begin GUI $Form = New-Object system.Windows.Forms.Form
$Form = New-Object System.Windows.Forms.Form $Form.ClientSize = New-Object System.Drawing.Point(500,570)
$Form.ClientSize = '800,500' $Form.StartPosition = 'CenterScreen'
$Form.Text = "Windows10Debloater" $Form.FormBorderStyle = 'FixedSingle'
$Form.TopMost = $false $Form.MinimizeBox = $false
$Form.MaximizeBox = $false
$Debloat = New-Object System.Windows.Forms.Label $Form.ShowIcon = $false
$Debloat.Text = "Debloat Options" $Form.text = "Windows10Debloader"
$Debloat.AutoSize = $true $Form.TopMost = $false
$Debloat.Width = 25 $Form.BackColor = [System.Drawing.ColorTranslator]::FromHtml("#252525")
$Debloat.Height = 10
$Debloat.Location = New-Object System.Drawing.Point(9, 8) $DebloatPanel = New-Object system.Windows.Forms.Panel
$Debloat.Font = 'Microsoft Sans Serif,12,style=Bold,Underline' $DebloatPanel.height = 160
$DebloatPanel.width = 480
$DebloatPanel.Anchor = 'top,right,left'
$CustomizeBlacklists = New-Object System.Windows.Forms.Button $DebloatPanel.location = New-Object System.Drawing.Point(10,10)
$CustomizeBlacklists.Text = "Customize Blacklist"
$CustomizeBlacklists.Width = 140 $RegistryPanel = New-Object system.Windows.Forms.Panel
$CustomizeBlacklists.Height = 40 $RegistryPanel.height = 80
$CustomizeBlacklists.Location = New-Object System.Drawing.Point(9, 32) $RegistryPanel.width = 480
$CustomizeBlacklists.Font = 'Microsoft Sans Serif,10' $RegistryPanel.Anchor = 'top,right,left'
$RegistryPanel.location = New-Object System.Drawing.Point(10,180)
$RemoveAllBloatware = New-Object System.Windows.Forms.Button
$RemoveAllBloatware.Text = "Remove All Bloatware" $CortanaPanel = New-Object system.Windows.Forms.Panel
$RemoveAllBloatware.Width = 142 $CortanaPanel.height = 120
$RemoveAllBloatware.Height = 40 $CortanaPanel.width = 153
$RemoveAllBloatware.Location = New-Object System.Drawing.Point(8, 79) $CortanaPanel.Anchor = 'top,right,left'
$RemoveAllBloatware.Font = 'Microsoft Sans Serif,10' $CortanaPanel.location = New-Object System.Drawing.Point(10,270)
$RemoveBlacklist = New-Object System.Windows.Forms.Button $EdgePanel = New-Object system.Windows.Forms.Panel
$RemoveBlacklist.Text = "Remove Bloatware With Customized Blacklist" $EdgePanel.height = 120
$RemoveBlacklist.Width = 205 $EdgePanel.width = 154
$RemoveBlacklist.Height = 37 $EdgePanel.Anchor = 'top,right,left'
$RemoveBlacklist.Location = New-Object System.Drawing.Point(9, 124) $EdgePanel.location = New-Object System.Drawing.Point(173,270)
$RemoveBlacklist.Font = 'Microsoft Sans Serif,10'
$DarkThemePanel = New-Object system.Windows.Forms.Panel
$Label1 = New-Object System.Windows.Forms.Label $DarkThemePanel.height = 120
$Label1.Text = "Revert Registry Changes" $DarkThemePanel.width = 153
$Label1.AutoSize = $true $DarkThemePanel.Anchor = 'top,right,left'
$Label1.Width = 25 $DarkThemePanel.location = New-Object System.Drawing.Point(337,270)
$Label1.Height = 10
$Label1.Location = New-Object System.Drawing.Point(254, 7) $OtherPanel = New-Object system.Windows.Forms.Panel
$Label1.Font = 'Microsoft Sans Serif,12,style=Bold,Underline' $OtherPanel.height = 160
$OtherPanel.width = 480
$RevertChange = New-Object System.Windows.Forms.Button $OtherPanel.Anchor = 'top,right,left'
$RevertChange.Text = "Revert Registry Changes" $OtherPanel.location = New-Object System.Drawing.Point(10,400)
$RevertChange.Width = 113
$RevertChange.Height = 36 $Debloat = New-Object system.Windows.Forms.Label
$RevertChange.Location = New-Object System.Drawing.Point(254, 32) $Debloat.text = "DEBLOAT OPTIONS"
$RevertChange.Font = 'Microsoft Sans Serif,10' $Debloat.AutoSize = $true
$Debloat.width = 457
$Label2 = New-Object System.Windows.Forms.Label $Debloat.height = 142
$Label2.Text = "Optional Changes/Fixes" $Debloat.Anchor = 'top,right,left'
$Label2.AutoSize = $true $Debloat.location = New-Object System.Drawing.Point(10,9)
$Label2.Width = 25 $Debloat.Font = New-Object System.Drawing.Font('Consolas',15,[System.Drawing.FontStyle]([System.Drawing.FontStyle]::Bold))
$Label2.Height = 10 $Debloat.ForeColor = [System.Drawing.ColorTranslator]::FromHtml("#eeeeee")
$Label2.Location = New-Object System.Drawing.Point(9, 193)
$Label2.Font = 'Microsoft Sans Serif,12,style=Bold,Underline' $CustomizeBlacklist = New-Object system.Windows.Forms.Button
$CustomizeBlacklist.FlatStyle = 'Flat'
$DisableCortana = New-Object System.Windows.Forms.Button $CustomizeBlacklist.text = "CUSTOMISE BLACKLIST"
$DisableCortana.Text = "Disable Cortana" $CustomizeBlacklist.width = 460
$DisableCortana.Width = 111 $CustomizeBlacklist.height = 30
$DisableCortana.Height = 36 $CustomizeBlacklist.Anchor = 'top,right,left'
$DisableCortana.Location = New-Object System.Drawing.Point(9, 217) $CustomizeBlacklist.location = New-Object System.Drawing.Point(10,40)
$DisableCortana.Font = 'Microsoft Sans Serif,10' $CustomizeBlacklist.Font = New-Object System.Drawing.Font('Consolas',9)
$CustomizeBlacklist.ForeColor = [System.Drawing.ColorTranslator]::FromHtml("#eeeeee")
$EnableCortana = New-Object System.Windows.Forms.Button
$EnableCortana.Text = "Enable Cortana" $RemoveAllBloatware = New-Object system.Windows.Forms.Button
$EnableCortana.Width = 112 $RemoveAllBloatware.FlatStyle = 'Flat'
$EnableCortana.Height = 36 $RemoveAllBloatware.text = "REMOVE ALL BLOATWARE"
$EnableCortana.Location = New-Object System.Drawing.Point(9, 260) $RemoveAllBloatware.width = 460
$EnableCortana.Font = 'Microsoft Sans Serif,10' $RemoveAllBloatware.height = 30
$RemoveAllBloatware.Anchor = 'top,right,left'
$StopEdgePDFTakeover = New-Object System.Windows.Forms.Button $RemoveAllBloatware.location = New-Object System.Drawing.Point(10,80)
$StopEdgePDFTakeover.Text = "Stop Edge PDF Takeover" $RemoveAllBloatware.Font = New-Object System.Drawing.Font('Consolas',9)
$StopEdgePDFTakeover.Width = 175 $RemoveAllBloatware.ForeColor = [System.Drawing.ColorTranslator]::FromHtml("#eeeeee")
$StopEdgePDFTakeover.Height = 35
$StopEdgePDFTakeover.Location = New-Object System.Drawing.Point(155, 217) $RemoveBlacklistedBloatware = New-Object system.Windows.Forms.Button
$StopEdgePDFTakeover.Font = 'Microsoft Sans Serif,10' $RemoveBlacklistedBloatware.FlatStyle = 'Flat'
$RemoveBlacklistedBloatware.text = "REMOVE BLOATWARE WITH CUSTOM BLACKLIST"
$EnableEdgePDFTakeover = New-Object System.Windows.Forms.Button $RemoveBlacklistedBloatware.width = 460
$EnableEdgePDFTakeover.Text = "Enable Edge PDF Takeover" $RemoveBlacklistedBloatware.height = 30
$EnableEdgePDFTakeover.Width = 185 $RemoveBlacklistedBloatware.Anchor = 'top,right,left'
$EnableEdgePDFTakeover.Height = 35 $RemoveBlacklistedBloatware.location = New-Object System.Drawing.Point(10,120)
$EnableEdgePDFTakeover.Location = New-Object System.Drawing.Point(155, 260) $RemoveBlacklistedBloatware.Font = New-Object System.Drawing.Font('Consolas',9)
$EnableEdgePDFTakeover.Font = 'Microsoft Sans Serif,10' $RemoveBlacklistedBloatware.ForeColor = [System.Drawing.ColorTranslator]::FromHtml("#eeeeee")
$DisableTelemetry = New-Object System.Windows.Forms.Button $Registry = New-Object system.Windows.Forms.Label
$DisableTelemetry.Text = "Disable Telemetry/Tasks" $Registry.text = "REGISTRY CHANGES"
$DisableTelemetry.Width = 152 $Registry.AutoSize = $true
$DisableTelemetry.Height = 35 $Registry.width = 457
$DisableTelemetry.Location = New-Object System.Drawing.Point(365, 260) $Registry.height = 142
$DisableTelemetry.Font = 'Microsoft Sans Serif,10' $Registry.Anchor = 'top,right,left'
$Registry.location = New-Object System.Drawing.Point(10,10)
$RemoveRegkeys = New-Object System.Windows.Forms.Button $Registry.Font = New-Object System.Drawing.Font('Consolas',15,[System.Drawing.FontStyle]([System.Drawing.FontStyle]::Bold))
$RemoveRegkeys.Text = "Remove Bloatware Regkeys" $Registry.ForeColor = [System.Drawing.ColorTranslator]::FromHtml("#eeeeee")
$RemoveRegkeys.Width = 188
$RemoveRegkeys.Height = 35 $RevertChanges = New-Object system.Windows.Forms.Button
$RemoveRegkeys.Location = New-Object System.Drawing.Point(540, 260) $RevertChanges.FlatStyle = 'Flat'
$RemoveRegkeys.Font = 'Microsoft Sans Serif,10' $RevertChanges.text = "REVERT REGISTRY CHANGES"
$RevertChanges.width = 460
$UnpinStartMenuTiles = New-Object System.Windows.Forms.Button $RevertChanges.height = 30
$UnpinStartMenuTiles.Text = "Unpin Tiles From Start Menu" $RevertChanges.Anchor = 'top,right,left'
$UnpinStartMenuTiles.Width = 190 $RevertChanges.location = New-Object System.Drawing.Point(10,40)
$UnpinStartMenuTiles.Height = 35 $RevertChanges.Font = New-Object System.Drawing.Font('Consolas',9)
$UnpinStartMenuTiles.Location = New-Object System.Drawing.Point(540, 217) $RevertChanges.ForeColor = [System.Drawing.ColorTranslator]::FromHtml("#eeeeee")
$UnpinStartMenuTiles.Font = 'Microsoft Sans Serif,10'
$Cortana = New-Object system.Windows.Forms.Label
$RemoveOnedrive = New-Object System.Windows.Forms.Button $Cortana.text = "CORTANA"
$RemoveOnedrive.Text = "Uninstall OneDrive" $Cortana.AutoSize = $true
$RemoveOnedrive.Width = 152 $Cortana.width = 457
$RemoveOnedrive.Height = 35 $Cortana.height = 142
$RemoveOnedrive.Location = New-Object System.Drawing.Point(365, 217) $Cortana.Anchor = 'top,right,left'
$RemoveOnedrive.Font = 'Microsoft Sans Serif,10' $Cortana.location = New-Object System.Drawing.Point(10,10)
$Cortana.Font = New-Object System.Drawing.Font('Consolas',15,[System.Drawing.FontStyle]([System.Drawing.FontStyle]::Bold))
#$FixWhitelist = New-Object System.Windows.Forms.Button $Cortana.ForeColor = [System.Drawing.ColorTranslator]::FromHtml("#eeeeee")
#$FixWhitelist.Text = "Fix Whitelisted Apps"
#$FixWhitelist.Width = 130 $EnableCortana = New-Object system.Windows.Forms.Button
#$FixWhitelist.Height = 37 $EnableCortana.FlatStyle = 'Flat'
#$FixWhitelist.Location = New-Object System.Drawing.Point(254, 74) $EnableCortana.text = "ENABLE"
#$FixWhitelist.Font = 'Microsoft Sans Serif,10' $EnableCortana.width = 133
$EnableCortana.height = 30
$InstallNet35 = New-Object System.Windows.Forms.Button $EnableCortana.Anchor = 'top,right,left'
$InstallNet35.Text = "Install .NET v3.5" $EnableCortana.location = New-Object System.Drawing.Point(10,40)
$InstallNet35.Width = 152 $EnableCortana.Font = New-Object System.Drawing.Font('Consolas',9)
$InstallNet35.Height = 39 $EnableCortana.ForeColor = [System.Drawing.ColorTranslator]::FromHtml("#eeeeee")
$InstallNet35.Location = New-Object System.Drawing.Point(169, 335)
$InstallNet35.Font = 'Microsoft Sans Serif,10' $DisableCortana = New-Object system.Windows.Forms.Button
$DisableCortana.FlatStyle = 'Flat'
$EnableDarkMode = New-Object System.Windows.Forms.Button $DisableCortana.text = "DISABLE"
$EnableDarkMode.Text = "Enable Dark Mode" $DisableCortana.width = 133
$EnableDarkMode.Width = 152 $DisableCortana.height = 30
$EnableDarkMode.Height = 39 $DisableCortana.Anchor = 'top,right,left'
$EnableDarkMode.Location = New-Object System.Drawing.Point(9, 335) $DisableCortana.location = New-Object System.Drawing.Point(10,80)
$EnableDarkMode.Font = 'Microsoft Sans Serif,10' $DisableCortana.Font = New-Object System.Drawing.Font('Consolas',9)
$DisableCortana.ForeColor = [System.Drawing.ColorTranslator]::FromHtml("#eeeeee")
$DisableDarkMode = New-Object System.Windows.Forms.Button
$DisableDarkMode.Text = "Disable Dark Mode" $Edge = New-Object system.Windows.Forms.Label
$DisableDarkMode.Width = 152 $Edge.text = "EDGE PDF"
$DisableDarkMode.Height = 39 $Edge.AutoSize = $true
$DisableDarkMode.Location = New-Object System.Drawing.Point(9, 385) $Edge.width = 457
$DisableDarkMode.Font = 'Microsoft Sans Serif,10' $Edge.height = 142
$Edge.Anchor = 'top,right,left'
$Edge.location = New-Object System.Drawing.Point(10,10)
$Edge.Font = New-Object System.Drawing.Font('Consolas',15,[System.Drawing.FontStyle]([System.Drawing.FontStyle]::Bold))
$Form.controls.AddRange(@($Debloat, $CustomizeBlacklists, $RemoveAllBloatware, $RemoveBlacklist, $Label1, $RevertChange, $Label2, $DisableCortana, $EnableCortana, $StopEdgePDFTakeover, $EnableEdgePDFTakeover, $DisableTelemetry, $RemoveRegkeys, $UnpinStartMenuTiles, $RemoveOnedrive, $FixWhitelist, $RemoveBloatNoBlacklist, $InstallNet35, $EnableDarkMode, $DisableDarkMode)) $Edge.ForeColor = [System.Drawing.ColorTranslator]::FromHtml("#eeeeee")
$EnableEdgePDFTakeover = New-Object system.Windows.Forms.Button
$EnableEdgePDFTakeover.FlatStyle = 'Flat'
$EnableEdgePDFTakeover.text = "ENABLE"
$EnableEdgePDFTakeover.width = 134
$EnableEdgePDFTakeover.height = 30
$EnableEdgePDFTakeover.Anchor = 'top,right,left'
$EnableEdgePDFTakeover.location = New-Object System.Drawing.Point(10,40)
$EnableEdgePDFTakeover.Font = New-Object System.Drawing.Font('Consolas',9)
$EnableEdgePDFTakeover.ForeColor = [System.Drawing.ColorTranslator]::FromHtml("#eeeeee")
$DisableEdgePDFTakeover = New-Object system.Windows.Forms.Button
$DisableEdgePDFTakeover.FlatStyle = 'Flat'
$DisableEdgePDFTakeover.text = "DISABLE"
$DisableEdgePDFTakeover.width = 134
$DisableEdgePDFTakeover.height = 30
$DisableEdgePDFTakeover.Anchor = 'top,right,left'
$DisableEdgePDFTakeover.location = New-Object System.Drawing.Point(10,80)
$DisableEdgePDFTakeover.Font = New-Object System.Drawing.Font('Consolas',9)
$DisableEdgePDFTakeover.ForeColor = [System.Drawing.ColorTranslator]::FromHtml("#eeeeee")
$Theme = New-Object system.Windows.Forms.Label
$Theme.text = "DARK THEME"
$Theme.AutoSize = $true
$Theme.width = 457
$Theme.height = 142
$Theme.Anchor = 'top,right,left'
$Theme.location = New-Object System.Drawing.Point(10,10)
$Theme.Font = New-Object System.Drawing.Font('Consolas',15,[System.Drawing.FontStyle]([System.Drawing.FontStyle]::Bold))
$Theme.ForeColor = [System.Drawing.ColorTranslator]::FromHtml("#eeeeee")
$EnableDarkMode = New-Object system.Windows.Forms.Button
$EnableDarkMode.FlatStyle = 'Flat'
$EnableDarkMode.text = "ENABLE"
$EnableDarkMode.width = 133
$EnableDarkMode.height = 30
$EnableDarkMode.Anchor = 'top,right,left'
$EnableDarkMode.location = New-Object System.Drawing.Point(10,40)
$EnableDarkMode.Font = New-Object System.Drawing.Font('Consolas',9)
$EnableDarkMode.ForeColor = [System.Drawing.ColorTranslator]::FromHtml("#eeeeee")
$DisableDarkMode = New-Object system.Windows.Forms.Button
$DisableDarkMode.FlatStyle = 'Flat'
$DisableDarkMode.text = "DISABLE"
$DisableDarkMode.width = 133
$DisableDarkMode.height = 30
$DisableDarkMode.Anchor = 'top,right,left'
$DisableDarkMode.location = New-Object System.Drawing.Point(10,80)
$DisableDarkMode.Font = New-Object System.Drawing.Font('Consolas',9)
$DisableDarkMode.ForeColor = [System.Drawing.ColorTranslator]::FromHtml("#eeeeee")
$Other = New-Object system.Windows.Forms.Label
$Other.text = "OTHER CHANGES & FIXES"
$Other.AutoSize = $true
$Other.width = 457
$Other.height = 142
$Other.Anchor = 'top,right,left'
$Other.location = New-Object System.Drawing.Point(10,10)
$Other.Font = New-Object System.Drawing.Font('Consolas',15,[System.Drawing.FontStyle]([System.Drawing.FontStyle]::Bold))
$Other.ForeColor = [System.Drawing.ColorTranslator]::FromHtml("#eeeeee")
$RemoveOnedrive = New-Object system.Windows.Forms.Button
$RemoveOnedrive.FlatStyle = 'Flat'
$RemoveOnedrive.text = "UNINSTALL ONEDRIVE"
$RemoveOnedrive.width = 225
$RemoveOnedrive.height = 30
$RemoveOnedrive.Anchor = 'top,right,left'
$RemoveOnedrive.location = New-Object System.Drawing.Point(10,40)
$RemoveOnedrive.Font = New-Object System.Drawing.Font('Consolas',9)
$RemoveOnedrive.ForeColor = [System.Drawing.ColorTranslator]::FromHtml("#eeeeee")
$UnpinStartMenuTiles = New-Object system.Windows.Forms.Button
$UnpinStartMenuTiles.FlatStyle = 'Flat'
$UnpinStartMenuTiles.text = "UNPIN TILES FROM START MENU"
$UnpinStartMenuTiles.width = 225
$UnpinStartMenuTiles.height = 30
$UnpinStartMenuTiles.Anchor = 'top,right,left'
$UnpinStartMenuTiles.location = New-Object System.Drawing.Point(245,40)
$UnpinStartMenuTiles.Font = New-Object System.Drawing.Font('Consolas',9)
$UnpinStartMenuTiles.ForeColor = [System.Drawing.ColorTranslator]::FromHtml("#eeeeee")
$DisableTelemetry = New-Object system.Windows.Forms.Button
$DisableTelemetry.FlatStyle = 'Flat'
$DisableTelemetry.text = "DISABLE TELEMETRY / TASKS"
$DisableTelemetry.width = 225
$DisableTelemetry.height = 30
$DisableTelemetry.Anchor = 'top,right,left'
$DisableTelemetry.location = New-Object System.Drawing.Point(10,80)
$DisableTelemetry.Font = New-Object System.Drawing.Font('Consolas',9)
$DisableTelemetry.ForeColor = [System.Drawing.ColorTranslator]::FromHtml("#eeeeee")
$RemoveRegkeys = New-Object system.Windows.Forms.Button
$RemoveRegkeys.FlatStyle = 'Flat'
$RemoveRegkeys.text = "REMOVE BLOATWARE REGKEYS"
$RemoveRegkeys.width = 225
$RemoveRegkeys.height = 30
$RemoveRegkeys.Anchor = 'top,right,left'
$RemoveRegkeys.location = New-Object System.Drawing.Point(245,80)
$RemoveRegkeys.Font = New-Object System.Drawing.Font('Consolas',9)
$RemoveRegkeys.ForeColor = [System.Drawing.ColorTranslator]::FromHtml("#eeeeee")
$InstallNet35 = New-Object system.Windows.Forms.Button
$InstallNet35.FlatStyle = 'Flat'
$InstallNet35.text = "INSTALL .NET V3.5"
$InstallNet35.width = 460
$InstallNet35.height = 30
$InstallNet35.Anchor = 'top,right,left'
$InstallNet35.location = New-Object System.Drawing.Point(10,120)
$InstallNet35.Font = New-Object System.Drawing.Font('Consolas',9)
$InstallNet35.ForeColor = [System.Drawing.ColorTranslator]::FromHtml("#eeeeee")
$Form.controls.AddRange(@($RegistryPanel,$DebloatPanel,$CortanaPanel,$EdgePanel,$DarkThemePanel,$OtherPanel))
$DebloatPanel.controls.AddRange(@($Debloat,$CustomizeBlacklist,$RemoveAllBloatware,$RemoveBlacklistedBloatware))
$RegistryPanel.controls.AddRange(@($Registry,$RevertChanges))
$CortanaPanel.controls.AddRange(@($Cortana,$EnableCortana,$DisableCortana))
$EdgePanel.controls.AddRange(@($EnableEdgePDFTakeover,$DisableEdgePDFTakeover,$Edge))
$DarkThemePanel.controls.AddRange(@($Theme,$DisableDarkMode,$EnableDarkMode))
$OtherPanel.controls.AddRange(@($Other,$RemoveOnedrive,$InstallNet35,$UnpinStartMenuTiles,$DisableTelemetry,$RemoveRegkeys))
$DebloatFolder = "C:\Temp\Windows10Debloater" $DebloatFolder = "C:\Temp\Windows10Debloater"
If (Test-Path $DebloatFolder) { If (Test-Path $DebloatFolder) {
@ -371,18 +489,38 @@ Else {
Start-Transcript -OutputDirectory "${DebloatFolder}" Start-Transcript -OutputDirectory "${DebloatFolder}"
#region gui events { #region gui events {
$CustomizeBlacklists.Add_Click( { $CustomizeBlacklist.Add_Click( {
$CustomizeForm = New-Object System.Windows.Forms.Form $CustomizeForm = New-Object System.Windows.Forms.Form
$CustomizeForm.ClientSize = '600,400' $CustomizeForm.ClientSize = New-Object System.Drawing.Point(500,570)
$CustomizeForm.Text = "Customize Whitelist and Blacklist" $CustomizeForm.StartPosition = 'CenterScreen'
$CustomizeForm.TopMost = $false $CustomizeForm.FormBorderStyle = 'FixedSingle'
$CustomizeForm.AutoScroll = $true $CustomizeForm.MinimizeBox = $false
$CustomizeForm.MaximizeBox = $false
$SaveList = New-Object System.Windows.Forms.Button $CustomizeForm.ShowIcon = $false
$SaveList.Text = "Save custom Whitelist and Blacklist to custom-lists.ps1" $CustomizeForm.Text = "Customize Whitelist and Blacklist"
$SaveList.AutoSize = $true $CustomizeForm.TopMost = $false
$SaveList.Location = New-Object System.Drawing.Point(200, 5) $CustomizeForm.AutoScroll = $false
$CustomizeForm.controls.Add($SaveList) $CustomizeForm.BackColor = [System.Drawing.ColorTranslator]::FromHtml("#252525")
$ListPanel = New-Object system.Windows.Forms.Panel
$ListPanel.height = 510
$ListPanel.width = 480
$ListPanel.Anchor = 'top,right,left'
$ListPanel.location = New-Object System.Drawing.Point(10,10)
$ListPanel.AutoScroll = $true
$ListPanel.BackColor = [System.Drawing.ColorTranslator]::FromHtml("#252525")
$SaveList = New-Object System.Windows.Forms.Button
$SaveList.FlatStyle = 'Flat'
$SaveList.Text = "Save custom Whitelist and Blacklist to custom-lists.ps1"
$SaveList.width = 480
$SaveList.height = 30
$SaveList.Location = New-Object System.Drawing.Point(10, 530)
$SaveList.Font = New-Object System.Drawing.Font('Consolas',9)
$SaveList.ForeColor = [System.Drawing.ColorTranslator]::FromHtml("#eeeeee")
$CustomizeForm.controls.AddRange(@($SaveList,$ListPanel))
$SaveList.Add_Click( { $SaveList.Add_Click( {
$ErrorActionPreference = 'SilentlyContinue' $ErrorActionPreference = 'SilentlyContinue'
@ -421,25 +559,33 @@ $CustomizeBlacklists.Add_Click( {
[bool] $enabled, [bool] $enabled,
[Parameter(Mandatory)] [Parameter(Mandatory)]
[bool] $checked, [bool] $checked,
[Parameter(Mandatory)]
[bool] $autocheck,
[string] $notes [string] $notes
) )
$label = New-Object System.Windows.Forms.Label $label = New-Object System.Windows.Forms.Label
$label.Location = New-Object System.Drawing.Point(2, (30 + $position * 16)) $label.Location = New-Object System.Drawing.Point(0, (2 + $position * 25))
$label.Text = $notes $label.Text = $notes
$label.Width = 300 $label.Font = New-Object System.Drawing.Font('Consolas',8)
$label.Width = 150
$label.Height = 16 $label.Height = 16
$Label.TextAlign = [System.Drawing.ContentAlignment]::TopRight $Label.TextAlign = [System.Drawing.ContentAlignment]::TopRight
$CustomizeForm.controls.Add($label) $label.ForeColor = [System.Drawing.ColorTranslator]::FromHtml("#888888")
$ListPanel.controls.AddRange(@($label))
$Checkbox = New-Object System.Windows.Forms.CheckBox $Checkbox = New-Object System.Windows.Forms.CheckBox
$Checkbox.Text = $appName $Checkbox.Text = $appName
$Checkbox.Location = New-Object System.Drawing.Point(320, (30 + $position * 16)) $CheckBox.Font = New-Object System.Drawing.Font('Consolas',8)
$CheckBox.FlatStyle = 'Flat'
$CheckBox.ForeColor = [System.Drawing.ColorTranslator]::FromHtml("#eeeeee")
$Checkbox.Location = New-Object System.Drawing.Point(160, (0 + $position * 25))
$Checkbox.Autosize = 1; $Checkbox.Autosize = 1;
$Checkbox.Checked = $checked $Checkbox.Checked = $checked
$Checkbox.Enabled = $enabled $Checkbox.Enabled = $enabled
$CustomizeForm.controls.Add($CheckBox) $CheckBox.AutoCheck = $autocheck
$ListPanel.controls.AddRange(@($CheckBox))
} }
@ -455,8 +601,8 @@ $CustomizeBlacklists.Add_Click( {
if ( $null -notmatch $Installed -and $Installed -cmatch $item) { $string += "Installed" } if ( $null -notmatch $Installed -and $Installed -cmatch $item) { $string += "Installed" }
if ( $null -notmatch $AllUsers -and $AllUsers -cmatch $item) { $string += " AllUsers" } if ( $null -notmatch $AllUsers -and $AllUsers -cmatch $item) { $string += " AllUsers" }
if ( $null -notmatch $Online -and $Online -cmatch $item) { $string += " Online" } if ( $null -notmatch $Online -and $Online -cmatch $item) { $string += " Online" }
$string += " NONREMOVABLE" $string += " NON-REMOVABLE"
AddAppToCustomizeForm $checkboxCounter $item $false $false $string AddAppToCustomizeForm $checkboxCounter $item $true $false $false $string
++$checkboxCounter ++$checkboxCounter
} }
ForEach ( $item in $global:WhiteListedApps ) { ForEach ( $item in $global:WhiteListedApps ) {
@ -466,7 +612,7 @@ $CustomizeBlacklists.Add_Click( {
if ( $null -notmatch $Installed -and $Installed -cmatch $item) { $string += "Installed" } if ( $null -notmatch $Installed -and $Installed -cmatch $item) { $string += "Installed" }
if ( $null -notmatch $AllUsers -and $AllUsers -cmatch $item) { $string += " AllUsers" } if ( $null -notmatch $AllUsers -and $AllUsers -cmatch $item) { $string += " AllUsers" }
if ( $null -notmatch $Online -and $Online -cmatch $item) { $string += " Online" } if ( $null -notmatch $Online -and $Online -cmatch $item) { $string += " Online" }
AddAppToCustomizeForm $checkboxCounter $item $true $false $string AddAppToCustomizeForm $checkboxCounter $item $true $false $true $string
++$checkboxCounter ++$checkboxCounter
} }
ForEach ( $item in $global:Bloatware ) { ForEach ( $item in $global:Bloatware ) {
@ -476,7 +622,7 @@ $CustomizeBlacklists.Add_Click( {
if ( $null -notmatch $Installed -and $Installed -cmatch $item) { $string += "Installed" } if ( $null -notmatch $Installed -and $Installed -cmatch $item) { $string += "Installed" }
if ( $null -notmatch $AllUsers -and $AllUsers -cmatch $item) { $string += " AllUsers" } if ( $null -notmatch $AllUsers -and $AllUsers -cmatch $item) { $string += " AllUsers" }
if ( $null -notmatch $Online -and $Online -cmatch $item) { $string += " Online" } if ( $null -notmatch $Online -and $Online -cmatch $item) { $string += " Online" }
AddAppToCustomizeForm $checkboxCounter $item $true $true $string AddAppToCustomizeForm $checkboxCounter $item $true $true $true $string
++$checkboxCounter ++$checkboxCounter
} }
ForEach ( $item in $AllUsers ) { ForEach ( $item in $AllUsers ) {
@ -486,7 +632,7 @@ $CustomizeBlacklists.Add_Click( {
if ( $null -notmatch $global:BloatwareRegex -and $item -cmatch $global:BloatwareRegex ) { 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 $Installed -and $Installed -cmatch $item) { $string += " Installed" }
if ( $null -notmatch $Online -and $Online -cmatch $item) { $string += " Online" } if ( $null -notmatch $Online -and $Online -cmatch $item) { $string += " Online" }
AddAppToCustomizeForm $checkboxCounter $item $true $true $string AddAppToCustomizeForm $checkboxCounter $item $true $true $true $string
++$checkboxCounter ++$checkboxCounter
} }
ForEach ( $item in $Installed ) { ForEach ( $item in $Installed ) {
@ -496,7 +642,7 @@ $CustomizeBlacklists.Add_Click( {
if ( $null -notmatch $global:BloatwareRegex -and $item -cmatch $global:BloatwareRegex ) { continue } if ( $null -notmatch $global:BloatwareRegex -and $item -cmatch $global:BloatwareRegex ) { continue }
if ( $null -notmatch $AllUsers -and $AllUsers -cmatch $item) { continue } if ( $null -notmatch $AllUsers -and $AllUsers -cmatch $item) { continue }
if ( $null -notmatch $Online -and $Online -cmatch $item) { $string += " Online" } if ( $null -notmatch $Online -and $Online -cmatch $item) { $string += " Online" }
AddAppToCustomizeForm $checkboxCounter $item $true $true $string AddAppToCustomizeForm $checkboxCounter $item $true $true $true $string
++$checkboxCounter ++$checkboxCounter
} }
ForEach ( $item in $Online ) { ForEach ( $item in $Online ) {
@ -506,15 +652,14 @@ $CustomizeBlacklists.Add_Click( {
if ( $null -notmatch $global:BloatwareRegex -and $item -cmatch $global:BloatwareRegex ) { continue } if ( $null -notmatch $global:BloatwareRegex -and $item -cmatch $global:BloatwareRegex ) { continue }
if ( $null -notmatch $Installed -and $Installed -cmatch $item) { continue } if ( $null -notmatch $Installed -and $Installed -cmatch $item) { continue }
if ( $null -notmatch $AllUsers -and $AllUsers -cmatch $item) { continue } if ( $null -notmatch $AllUsers -and $AllUsers -cmatch $item) { continue }
AddAppToCustomizeForm $checkboxCounter $item $true $true $string AddAppToCustomizeForm $checkboxCounter $item $true $true $true $string
++$checkboxCounter ++$checkboxCounter
} }
[void]$CustomizeForm.ShowDialog() [void]$CustomizeForm.ShowDialog()
}) })
$RemoveBlacklist.Add_Click( { $RemoveBlacklistedBloatware.Add_Click( {
$ErrorActionPreference = 'SilentlyContinue' $ErrorActionPreference = 'SilentlyContinue'
Function DebloatBlacklist { Function DebloatBlacklist {
Write-Host "Requesting removal of $global:BloatwareRegex" Write-Host "Requesting removal of $global:BloatwareRegex"
@ -788,7 +933,7 @@ $RemoveAllBloatware.Add_Click( {
Write-Host "Finished all tasks. `n" Write-Host "Finished all tasks. `n"
} ) } )
$RevertChange.Add_Click( { $RevertChanges.Add_Click( {
$ErrorActionPreference = 'SilentlyContinue' $ErrorActionPreference = 'SilentlyContinue'
#This function will revert the changes you made when running the Start-Debloat function. #This function will revert the changes you made when running the Start-Debloat function.
@ -915,7 +1060,7 @@ $DisableCortana.Add_Click( {
Set-ItemProperty $Cortana3 HarvestContacts -Value 0 Set-ItemProperty $Cortana3 HarvestContacts -Value 0
Write-Host "Cortana has been disabled." Write-Host "Cortana has been disabled."
}) })
$StopEdgePDFTakeover.Add_Click( { $DisableEdgePDFTakeover.Add_Click( {
$ErrorActionPreference = 'SilentlyContinue' $ErrorActionPreference = 'SilentlyContinue'
#Stops edge from taking over as the default .PDF viewer #Stops edge from taking over as the default .PDF viewer
Write-Host "Stopping Edge from taking over as the default .PDF viewer" Write-Host "Stopping Edge from taking over as the default .PDF viewer"

Loading…
Cancel
Save