Merge pull request #138 from jstnlth/customLists

Custom lists
This commit is contained in:
Richard Newton 2019-06-01 20:42:15 -07:00 committed by GitHub
commit 4b5af129b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 332 additions and 92 deletions

View File

@ -107,7 +107,6 @@ Function DebloatBlacklist {
"*Sway*"
"*Speed Test*"
"*Dolby*"
"*Windows.CBSPreview*"
#Optional: Typically not removed but you can if you need to for some reason
#"*Microsoft.Advertising.Xaml_10.1712.5.0_x64__8wekyb3d8bbwe*"

View File

@ -511,7 +511,6 @@ $listBox.SelectionMode = 'MultiExtended'
[void] $listBox.Items.Add('*Sway*')
[void] $listBox.Items.Add('*Speed Test*')
[void] $listBox.Items.Add('*Dolby*')
[void] $listBox.Items.Add('*Windows.CBSPreview*')
[void] $listBox.Items.Add('*Microsoft.Advertising.Xaml_10.1712.5.0_x64__8wekyb3d8bbwe*')
[void] $listBox.Items.Add('*Microsoft.Advertising.Xaml_10.1712.5.0_x86__8wekyb3d8bbwe*')
[void] $listBox.Items.Add('*Microsoft.BingWeather*')

View File

@ -12,6 +12,172 @@ If (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]:
Exit
}
#Unnecessary Windows 10 AppX apps that will be removed by the blacklist.
$global:Bloatware = @(
"Microsoft.BingNews"
"Microsoft.GetHelp"
"Microsoft.Getstarted"
"Microsoft.Messaging"
"Microsoft.Microsoft3DViewer"
"Microsoft.MicrosoftOfficeHub"
"Microsoft.MicrosoftSolitaireCollection"
"Microsoft.NetworkSpeedTest"
"Microsoft.News" # Issue 77
"Microsoft.Office.Lens" # Issue 77
"Microsoft.Office.OneNote"
"Microsoft.Office.Sway"
"Microsoft.OneConnect"
"Microsoft.People"
"Microsoft.Print3D"
"Microsoft.RemoteDesktop" # Issue 120
"Microsoft.SkypeApp"
"Microsoft.StorePurchaseApp"
"Microsoft.Office.Todo.List" # Issue 77
"Microsoft.Whiteboard" # Issue 77
"Microsoft.WindowsAlarms"
"microsoft.windowscommunicationsapps"
"Microsoft.WindowsFeedbackHub"
"Microsoft.WindowsMaps"
"Microsoft.WindowsSoundRecorder"
"Microsoft.Xbox.TCUI"
"Microsoft.XboxApp"
"Microsoft.XboxGameOverlay"
"Microsoft.XboxGamingOverlay"
"Microsoft.XboxIdentityProvider"
"Microsoft.XboxSpeechToTextOverlay"
"Microsoft.ZuneMusic"
"Microsoft.ZuneVideo"
#Sponsored Windows 10 AppX Apps
#Add sponsored/featured apps to remove in the "*AppName*" format
"EclipseManager"
"ActiproSoftwareLLC"
"AdobeSystemsIncorporated.AdobePhotoshopExpress"
"Duolingo-LearnLanguagesforFree"
"PandoraMediaInc"
"CandyCrush"
"Wunderlist"
"Flipboard"
"Twitter"
"Facebook"
"Spotify" # Issue 123
"Minecraft"
"Royal Revolt"
"Sway" # Issue 77
"Dolby" # Issue 78
#Optional: Typically not removed but you can if you need to for some reason
#"Microsoft.Advertising.Xaml_10.1712.5.0_x64__8wekyb3d8bbwe"
#"Microsoft.Advertising.Xaml_10.1712.5.0_x86__8wekyb3d8bbwe"
#"Microsoft.BingWeather"
)
#Valuable Windows 10 AppX apps that most people want to keep. Protected from DeBloat All.
#Credit to /u/GavinEke for a modified version of my whitelist code
$global:WhiteListedApps = @(
"Microsoft.WindowsCalculator" # Microsoft removed legacy calculator
"Microsoft.WindowsStore" # Issue 1
"Microsoft.Windows.Photos" # Microsoft disabled/hid legacy photo viewer
"CanonicalGroupLimited.UbuntuonWindows" # Issue 10
"Microsoft.Xbox.TCUI" # Issue 25, 91 Many home users want to play games
"Microsoft.XboxApp"
"Microsoft.XboxGameOverlay"
"Microsoft.XboxGamingOverlay" # Issue 25, 91 Many home users want to play games
"Microsoft.XboxIdentityProvider" # Issue 25, 91 Many home users want to play games
"Microsoft.XboxSpeechToTextOverlay"
"Microsoft.MicrosoftStickyNotes" # Issue 33 New functionality.
"Microsoft.MSPaint" # Issue 32 This is Paint3D, legacy paint still exists in Windows 10
"Microsoft.WindowsCamera" # Issue 65 New functionality.
"\.NET"
"Microsoft.HEIFImageExtension" # Issue 68
"Microsoft.ScreenSketch" # Issue 55: Looks like Microsoft will be axing snipping tool and using Snip & Sketch going forward
"Microsoft.StorePurchaseApp" # Issue 68
"Microsoft.VP9VideoExtensions" # Issue 68
"Microsoft.WebMediaExtensions" # Issue 68
"Microsoft.WebpImageExtension" # Issue 68
"Microsoft.DesktopAppInstaller" # Issue 68
"WindSynthBerry" # Issue 68
"MIDIBerry" # Issue 68
"Slack" # Issue 83
)
#NonRemovable Apps that where getting attempted and the system would reject the uninstall, speeds up debloat and prevents 'initalizing' overlay when removing apps
$NonRemovables = Get-AppxPackage -AllUsers | Where-Object {$_.NonRemovable -eq $true} | foreach{$_.Name}
$NonRemovables += Get-AppxPackage | Where-Object {$_.NonRemovable -eq $true} | foreach{$_.Name}
$NonRemovables += Get-AppxProvisionedPackage -Online | Where-Object {$_.NonRemovable -eq $true} | foreach{$_.DisplayName}
$NonRemovables = $NonRemovables | Sort-Object -unique
if ($NonRemovables -eq $null ) { # the .NonRemovable property doesn't exist until version 18xx. Use a hard-coded list instead.
#WARNING: only use exact names here - no short names or wildcards
$NonRemovables = @(
"1527c705-839a-4832-9118-54d4Bd6a0c89"
"c5e2524a-ea46-4f67-841f-6a9465d9d515"
"E2A4F912-2574-4A75-9BB0-0D023378592B"
"F46D4000-FD22-4DB4-AC8E-4E1DDDE828FE"
"InputApp"
"Microsoft.AAD.BrokerPlugin"
"Microsoft.AccountsControl"
"Microsoft.BioEnrollment"
"Microsoft.CredDialogHost"
"Microsoft.ECApp"
"Microsoft.LockApp"
"Microsoft.MicrosoftEdgeDevToolsClient"
"Microsoft.MicrosoftEdge"
"Microsoft.PPIProjection"
"Microsoft.Win32WebViewHost"
"Microsoft.Windows.Apprep.ChxApp"
"Microsoft.Windows.AssignedAccessLockApp"
"Microsoft.Windows.CapturePicker"
"Microsoft.Windows.CloudExperienceHost"
"Microsoft.Windows.ContentDeliveryManager"
"Microsoft.Windows.Cortana"
"Microsoft.Windows.HolographicFirstRun" # Added 1709
"Microsoft.Windows.NarratorQuickStart"
"Microsoft.Windows.OOBENetworkCaptivePortal" # Added 1709
"Microsoft.Windows.OOBENetworkConnectionFlow" # Added 1709
"Microsoft.Windows.ParentalControls"
"Microsoft.Windows.PeopleExperienceHost"
"Microsoft.Windows.PinningConfirmationDialog"
"Microsoft.Windows.SecHealthUI" # Issue 117 Windows Defender
"Microsoft.Windows.SecondaryTileExperience" # Added 1709
"Microsoft.Windows.SecureAssessmentBrowser"
"Microsoft.Windows.ShellExperienceHost"
"Microsoft.Windows.XGpuEjectDialog"
"Microsoft.XboxGameCallableUI" # Issue 91
"Windows.CBSPreview"
"windows.immersivecontrolpanel"
"Windows.PrintDialog"
"Microsoft.VCLibs.140.00"
"Microsoft.Services.Store.Engagement"
"Microsoft.UI.Xaml.2.0"
)
}
# import library code - located relative to this script
Function dotInclude() {
Param(
[Parameter(Mandatory)]
[string]$includeFile
)
# Look for the file in the same directory as this script
$scriptPath = $PSScriptRoot
if ( $PSScriptRoot -eq $null -and $psISE) {
$scriptPath = (Split-Path -Path $psISE.CurrentFile.FullPath)
}
if ( test-path $scriptPath\$includeFile ){
# import and immediately execute the requested file
. $scriptPath\$includeFile
}
}
# Override built-in blacklist/whitelist with user defined lists
dotInclude 'custom-lists.ps1'
#convert to regular expression to allow for the super-useful -match operator
$global:BloatwareRegex = $global:Bloatware -join '|'
$global:WhiteListedAppsRegex = $global:WhiteListedApps -join '|'
# This form was created using POSHGUI.com a free online gui designer for PowerShell
Add-Type -AssemblyName System.Windows.Forms
[System.Windows.Forms.Application]::EnableVisualStyles()
@ -30,18 +196,26 @@ $Debloat.height = 10
$Debloat.location = New-Object System.Drawing.Point(9, 8)
$Debloat.Font = 'Microsoft Sans Serif,12,style=Bold,Underline'
$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)
$CustomizeBlacklists.Font = 'Microsoft Sans Serif,10'
$RemoveAllBloatware = New-Object system.Windows.Forms.Button
$RemoveAllBloatware.text = "Remove All Bloatware"
$RemoveAllBloatware.width = 142
$RemoveAllBloatware.height = 40
$RemoveAllBloatware.location = New-Object System.Drawing.Point(8, 32)
$RemoveAllBloatware.location = New-Object System.Drawing.Point(8, 79)
$RemoveAllBloatware.Font = 'Microsoft Sans Serif,10'
$RemoveBlacklist = New-Object system.Windows.Forms.Button
$RemoveBlacklist.text = "Remove Bloatware With Blacklist"
$RemoveBlacklist.width = 205
$RemoveBlacklist.height = 37
$RemoveBlacklist.location = New-Object System.Drawing.Point(9, 79)
$RemoveBlacklist.location = New-Object System.Drawing.Point(9, 124)
$RemoveBlacklist.Font = 'Microsoft Sans Serif,10'
$Label1 = New-Object system.Windows.Forms.Label
@ -153,7 +327,7 @@ $DisableDarkMode.Font = 'Microsoft Sans Serif,10'
$Form.controls.AddRange(@($Debloat, $RemoveAllBloatware, $RemoveBlacklist, $Label1, $RevertChange, $Label2, $DisableCortana, $EnableCortana, $StopEdgePDFTakeover, $EnableEdgePDFTakeover, $DisableTelemetry, $RemoveRegkeys, $UnpinStartMenuTiles, $RemoveOnedrive, $FixWhitelist, $RemoveBloatNoBlacklist, $InstallNet35, $EnableDarkMode, $DisableDarkMode))
$Form.controls.AddRange(@($Debloat, $CustomizeBlacklists, $RemoveAllBloatware, $RemoveBlacklist, $Label1, $RevertChange, $Label2, $DisableCortana, $EnableCortana, $StopEdgePDFTakeover, $EnableEdgePDFTakeover, $DisableTelemetry, $RemoveRegkeys, $UnpinStartMenuTiles, $RemoveOnedrive, $FixWhitelist, $RemoveBloatNoBlacklist, $InstallNet35, $EnableDarkMode, $DisableDarkMode))
$DebloatFolder = "C:\Temp\Windows10Debloater"
If (Test-Path $DebloatFolder) {
@ -169,85 +343,163 @@ Else {
Start-Transcript -OutputDirectory "$DebloatFolder"
#region gui events {
$CustomizeBlacklists.Add_Click( {
$CustomizeForm = New-Object system.Windows.Forms.Form
$CustomizeForm.ClientSize = '600,400'
$CustomizeForm.text = "Customize Whitelist and Blacklist"
$CustomizeForm.TopMost = $false
$CustomizeForm.AutoScroll = $true
$SaveList = New-Object system.Windows.Forms.Button
$SaveList.text = "Save custom Whitelist and Blacklist to custom-lists.ps1"
$SaveList.AutoSize = $true
$SaveList.location = New-Object System.Drawing.Point(200, 5)
$CustomizeForm.controls.Add($SaveList)
$SaveList.Add_Click( {
$ErrorActionPreference = 'silentlycontinue'
'$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
'$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
)
$label=New-Object system.Windows.Forms.Label
$label.Location = New-Object System.Drawing.Point(2,(30+$position*16))
$label.Text = $notes
$label.width = 300
$label.height= 16
$Label.TextAlign = [System.Drawing.ContentAlignment]::TopRight
$CustomizeForm.controls.Add($label)
$Checkbox = New-Object system.Windows.Forms.CheckBox
$Checkbox.text = $appName
$Checkbox.location = New-Object System.Drawing.Point(320,(30+$position*16))
$Checkbox.Autosize = 1;
$Checkbox.Checked = $checked
$Checkbox.Enabled = $enabled
$CustomizeForm.controls.Add($CheckBox)
}
$Installed = @( (Get-AppxPackage).Name )
$Online = @( (Get-AppxProvisionedPackage -Online).DisplayName )
$AllUsers = @( (Get-AppxPackage -AllUsers).Name )
[int]$checkboxCounter = 0
foreach ($item in $NonRemovables) {
$string = ""
if ( $null -notmatch $global:BloatwareRegex -and $item -cmatch $global:BloatwareRegex ) {$string += " ConflictBlacklist "}
if ( $null -notmatch $global:WhiteListedAppsRegex -and $item -cmatch $global:WhiteListedAppsRegex ) {$string += " ConflictWhitelist" }
if ( $null -notmatch $Installed -and $Installed -cmatch $item){ $string += "Installed"}
if ( $null -notmatch $AllUsers -and $AllUsers -cmatch $item) {$string += " AllUsers"}
if ( $null -notmatch $Online -and $Online -cmatch $item) {$string += " Online"}
$string += " NONREMOVABLE"
AddAppToCustomizeForm $checkboxCounter $item $false $false $string
++$checkboxCounter
}
foreach ( $item in $global:WhiteListedApps ) {
$string = ""
if ( $null -notmatch $NonRemovables -and $NonRemovables -cmatch $item ) {$string += " Conflict NonRemovables "}
if ( $null -notmatch $global:BloatwareRegex -and $item -cmatch $global:BloatwareRegex ) {$string += " ConflictBlacklist "}
if ( $null -notmatch $Installed -and $Installed -cmatch $item){ $string += "Installed"}
if ( $null -notmatch $AllUsers -and $AllUsers -cmatch $item) {$string += " AllUsers"}
if ( $null -notmatch $Online -and $Online -cmatch $item) {$string += " Online"}
AddAppToCustomizeForm $checkboxCounter $item $true $false $string
++$checkboxCounter
}
foreach ( $item in $global:Bloatware ) {
$string = ""
if ( $null -notmatch $NonRemovables -and $NonRemovables -cmatch $item ) {$string += " Conflict NonRemovables "}
if ( $null -notmatch $global:WhiteListedAppsRegex -and $item -cmatch $global:WhiteListedAppsRegex ) {$string += " Conflict Whitelist "}
if ( $null -notmatch $Installed -and $Installed -cmatch $item){ $string += "Installed"}
if ( $null -notmatch $AllUsers -and $AllUsers -cmatch $item) {$string += " AllUsers"}
if ( $null -notmatch $Online -and $Online -cmatch $item) {$string += " Online"}
AddAppToCustomizeForm $checkboxCounter $item $true $true $string
++$checkboxCounter
}
foreach ( $item in $AllUsers ) {
$string = "NEW AllUsers"
if ( $null -notmatch $NonRemovables -and $NonRemovables -cmatch $item ) {continue}
if ( $null -notmatch $global:WhiteListedAppsRegex -and $item -cmatch $global:WhiteListedAppsRegex ) {continue}
if ( $null -notmatch $global:BloatwareRegex -and $item -cmatch $global:BloatwareRegex ) {continue}
if ( $null -notmatch $Installed -and $Installed -cmatch $item){ $string += " Installed"}
if ( $null -notmatch $Online -and $Online -cmatch $item) {$string += " Online"}
AddAppToCustomizeForm $checkboxCounter $item $true $true $string
++$checkboxCounter
}
foreach ( $item in $Installed ) {
$string = "NEW Installed"
if ( $null -notmatch $NonRemovables -and $NonRemovables -cmatch $item ) {continue}
if ( $null -notmatch $global:WhiteListedAppsRegex -and $item -cmatch $global:WhiteListedAppsRegex ) {continue}
if ( $null -notmatch $global:BloatwareRegex -and $item -cmatch $global:BloatwareRegex ) {continue}
if ( $null -notmatch $AllUsers -and $AllUsers -cmatch $item) {continue}
if ( $null -notmatch $Online -and $Online -cmatch $item) {$string += " Online"}
AddAppToCustomizeForm $checkboxCounter $item $true $true $string
++$checkboxCounter
}
foreach ( $item in $Online ) {
$string = "NEW Online "
if ( $null -notmatch $NonRemovables -and $NonRemovables -cmatch $item ) {continue}
if ( $null -notmatch $global:WhiteListedAppsRegex -and $item -cmatch $global:WhiteListedAppsRegex ) {continue}
if ( $null -notmatch $global:BloatwareRegex -and $item -cmatch $global:BloatwareRegex ) {continue}
if ( $null -notmatch $Installed -and $Installed -cmatch $item){ continue}
if ( $null -notmatch $AllUsers -and $AllUsers -cmatch $item) { continue}
AddAppToCustomizeForm $checkboxCounter $item $true $true $string
++$checkboxCounter
}
[void]$CustomizeForm.ShowDialog()
})
$RemoveBlacklist.Add_Click( {
$ErrorActionPreference = 'silentlycontinue'
Function DebloatBlacklist {
$Bloatware = @(
#Unnecessary Windows 10 AppX Apps
"Microsoft.BingNews"
"Microsoft.GetHelp"
"Microsoft.Getstarted"
"Microsoft.Messaging"
"Microsoft.Microsoft3DViewer"
"Microsoft.MicrosoftOfficeHub"
"Microsoft.MicrosoftSolitaireCollection"
"Microsoft.NetworkSpeedTest"
"Microsoft.News"
"Microsoft.Office.Lens"
"Microsoft.Office.OneNote"
"Microsoft.Office.Sway"
"Microsoft.OneConnect"
"Microsoft.People"
"Microsoft.Print3D"
"Microsoft.RemoteDesktop"
"Microsoft.SkypeApp"
"Microsoft.StorePurchaseApp"
"Microsoft.Office.Todo.List"
"Microsoft.Whiteboard"
"Microsoft.WindowsAlarms"
#"Microsoft.WindowsCamera"
"microsoft.windowscommunicationsapps"
"Microsoft.WindowsFeedbackHub"
"Microsoft.WindowsMaps"
"Microsoft.WindowsSoundRecorder"
"Microsoft.Xbox.TCUI"
"Microsoft.XboxApp"
"Microsoft.XboxGameOverlay"
"Microsoft.XboxIdentityProvider"
"Microsoft.XboxSpeechToTextOverlay"
"Microsoft.ZuneMusic"
"Microsoft.ZuneVideo"
#Sponsored Windows 10 AppX Apps
#Add sponsored/featured apps to remove in the "*AppName*" format
"*EclipseManager*"
"*ActiproSoftwareLLC*"
"*AdobeSystemsIncorporated.AdobePhotoshopExpress*"
"*Duolingo-LearnLanguagesforFree*"
"*PandoraMediaInc*"
"*CandyCrush*"
"*Wunderlist*"
"*Flipboard*"
"*Twitter*"
"*Facebook*"
"*Spotify*"
"*Minecraft*"
"*Royal Revolt*"
"*Sway*"
"*Dolby*"
"*Windows.CBSPreview*"
#Optional: Typically not removed but you can if you need to for some reason
#"*Microsoft.Advertising.Xaml_10.1712.5.0_x64__8wekyb3d8bbwe*"
#"*Microsoft.Advertising.Xaml_10.1712.5.0_x86__8wekyb3d8bbwe*"
#"*Microsoft.BingWeather*"
#"*Microsoft.MSPaint*"
#"*Microsoft.MicrosoftStickyNotes*"
#"*Microsoft.Windows.Photos*"
#"*Microsoft.WindowsCalculator*"
#"*Microsoft.WindowsStore*"
)
foreach ($Bloat in $Bloatware) {
Get-AppxPackage -Name $Bloat| Remove-AppxPackage
Get-AppxProvisionedPackage -Online | Where-Object DisplayName -like $Bloat | Remove-AppxProvisionedPackage -Online
Write-Host "Trying to remove $Bloat."
Write-Host "Bloatware removed!"
}
Write-Host "Requesting removal of $global:BloatwareRegex"
Write-Host "--- This may take a while - please be patient ---"
Get-AppxPackage | Where-Object Name -cmatch $global:BloatwareRegex | Remove-AppxPackage
Write-Host "...now starting the silent ProvisionedPackage bloatware removal..."
Get-AppxProvisionedPackage -Online | Where-Object DisplayName -cmatch $global:BloatwareRegex | Remove-AppxProvisionedPackage -Online
Write-Host "...and the final cleanup..."
Get-AppxPackage -AllUsers | Where-Object Name -cmatch $global:BloatwareRegex | Remove-AppxPackage
}
Write-Host "Removing Bloatware with a specific blacklist."
Write-Host "`n`n`n`n`n`n`n`n`n`n`n`n`n`n`n`n`nRemoving blacklisted Bloatware.`n"
DebloatBlacklist
Write-Host "Bloatware removed!"
})
$RemoveAllBloatware.Add_Click( {
$ErrorActionPreference = 'silentlycontinue'
@ -291,19 +543,9 @@ $RemoveAllBloatware.Add_Click( {
Function DebloatAll {
#Removes AppxPackages
#Credit to /u/GavinEke for a modified version of my whitelist code
$WhitelistedApps = 'Microsoft.ScreenSketch|Microsoft.Paint3D|Microsoft.WindowsCalculator|Microsoft.WindowsStore|Microsoft.Windows.Photos|CanonicalGroupLimited.UbuntuonWindows|`
Microsoft.XboxGameCallableUI|Microsoft.XboxGamingOverlay|Microsoft.Xbox.TCUI|Microsoft.XboxGamingOverlay|Microsoft.XboxIdentityProvider|Microsoft.MicrosoftStickyNotes|Microsoft.MSPaint|Microsoft.WindowsCamera|.NET|Framework|`
Microsoft.HEIFImageExtension|Microsoft.ScreenSketch|Microsoft.StorePurchaseApp|Microsoft.VP9VideoExtensions|Microsoft.WebMediaExtensions|Microsoft.WebpImageExtension|Microsoft.DesktopAppInstaller|WindSynthBerry|MIDIBerry|Slack'
#NonRemovable Apps that where getting attempted and the system would reject the uninstall, speeds up debloat and prevents 'initalizing' overlay when removing apps
$NonRemovable = '1527c705-839a-4832-9118-54d4Bd6a0c89|c5e2524a-ea46-4f67-841f-6a9465d9d515|E2A4F912-2574-4A75-9BB0-0D023378592B|F46D4000-FD22-4DB4-AC8E-4E1DDDE828FE|InputApp|Microsoft.AAD.BrokerPlugin|Microsoft.AccountsControl|`
Microsoft.BioEnrollment|Microsoft.CredDialogHost|Microsoft.ECApp|Microsoft.LockApp|Microsoft.MicrosoftEdgeDevToolsClient|Microsoft.MicrosoftEdge|Microsoft.PPIProjection|Microsoft.Win32WebViewHost|Microsoft.Windows.Apprep.ChxApp|`
Microsoft.Windows.AssignedAccessLockApp|Microsoft.Windows.CapturePicker|Microsoft.Windows.CloudExperienceHost|Microsoft.Windows.ContentDeliveryManager|Microsoft.Windows.Cortana|Microsoft.Windows.NarratorQuickStart|`
Microsoft.Windows.ParentalControls|Microsoft.Windows.PeopleExperienceHost|Microsoft.Windows.PinningConfirmationDialog|Microsoft.Windows.SecHealthUI|Microsoft.Windows.SecureAssessmentBrowser|Microsoft.Windows.ShellExperienceHost|`
Microsoft.Windows.XGpuEjectDialog|Microsoft.XboxGameCallableUI|Windows.CBSPreview|windows.immersivecontrolpanel|Windows.PrintDialog|Microsoft.VCLibs.140.00|Microsoft.Services.Store.Engagement|Microsoft.UI.Xaml.2.0'
Get-AppxPackage -AllUsers | Where {$_.Name -NotMatch $WhitelistedApps -and $_.Name -NotMatch $NonRemovable} | Remove-AppxPackage
Get-AppxPackage | Where {$_.Name -NotMatch $WhitelistedApps -and $_.Name -NotMatch $NonRemovable} | Remove-AppxPackage
Get-AppxProvisionedPackage -Online | Where {$_.Name -NotMatch $WhitelistedApps -and $_.Name -NotMatch $NonRemovable} | Remove-AppxProvisionedPackage -Online
Get-AppxPackage | Where { !($_.Name -cmatch $global:WhiteListedAppsRegex) -and !($NonRemovables -cmatch $_.Name) } | Remove-AppxPackage
Get-AppxProvisionedPackage -Online | Where { !($_.DisplayName -cmatch $global:WhiteListedAppsRegex) -and !($NonRemovables -cmatch $_.DisplayName) } | Remove-AppxProvisionedPackage -Online
Get-AppxPackage -AllUsers | Where { !($_.Name -cmatch $global:WhiteListedAppsRegex) -and !($NonRemovables -cmatch $_.Name) } | Remove-AppxPackage
}
#Creates a PSDrive to be able to access the 'HKCR' tree