Added new DebloatBlacklist function

pull/53/head
Richard Newton 6 years ago committed by GitHub
parent 5ed3bc2fa0
commit 2326d4ba79
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -6,11 +6,12 @@
$ErrorActionPreference = 'SilentlyContinue'
param (
[switch]$Debloat, [switch]$SysPrep, [switch]$StopEdgePDF, [Switch]$Privacy
[switch]$DebloatAllApps, [switch]$DebloatSpecificApps, [switch]$SysPrep, [switch]$StopEdgePDF, [Switch]$Privacy
)
Function Begin-SysPrep {
[CmdletBinding()]
param([switch]$SysPrep)
Write-Verbose -Message ('Starting Sysprep Fixes')
@ -40,12 +41,12 @@ Function Begin-SysPrep {
Stop-Service InstallService
Write-Verbose -Message ('Setting InstallService Startup to Disabled')
& sc config InstallService start=disabled
}
}
Function Start-Debloat {
Function DebloatAll {
param([switch]$Debloat)
param([switch]$DebloatAllApps)
#Removes AppxPackages
#Credit to Reddit user /u/GavinEke for a modified version of my whitelist code
@ -56,9 +57,80 @@ Function Start-Debloat {
}
Function DebloatBlacklist {
[CmdletBinding()]
Param ([switch]$DebloatSpecificApps)
$Bloatware = @(
#Unnecessary Windows 10 AppX Apps
"Microsoft.BingNews"
"Microsoft.DesktopAppInstaller"
"Microsoft.GetHelp"
"Microsoft.Getstarted"
"Microsoft.Messaging"
"Microsoft.Microsoft3DViewer"
"Microsoft.MicrosoftOfficeHub"
"Microsoft.MicrosoftSolitaireCollection"
"Microsoft.NetworkSpeedTest"
"Microsoft.Office.OneNote"
"Microsoft.Office.Sway"
"Microsoft.OneConnect"
"Microsoft.People"
"Microsoft.Print3D"
"Microsoft.RemoteDesktop"
"Microsoft.SkypeApp"
"Microsoft.StorePurchaseApp"
"Microsoft.WindowsAlarms"
"Microsoft.WindowsCamera"
"microsoft.windowscommunicationsapps"
"Microsoft.WindowsFeedbackHub"
"Microsoft.WindowsMaps"
"Microsoft.WindowsSoundRecorder"
"Microsoft.Xbox.TCUI"
"Microsoft.XboxApp"
"Microsoft.XboxGameOverlay"
"Microsoft.XboxIdentityProvider"
"Microsoft.XboxSpeechToTextOverlay"
"Microsoft.ZuneMusic"
"Microsoft.ZuneVideo"
#Sponsored Windows 10 AppX Apps
#Add sponsored/featured apps to remove in the "*AppName*" format
"EclipseManager"
"ActiproSoftwareLLC"
"AdobeSystemsIncorporated.AdobePhotoshopExpress"
"Duolingo-LearnLanguagesforFree"
"PandoraMediaInc"
"CandyCrush"
"Wunderlist"
"Flipboard"
"Twitter"
"Facebook"
"Spotify"
"Minecraft"
"Royal Revolt"
#Optional: Typically not removed but you can if you need to for some reason
#"*Microsoft.Advertising.Xaml_10.1712.5.0_x64__8wekyb3d8bbwe*"
#"*Microsoft.Advertising.Xaml_10.1712.5.0_x86__8wekyb3d8bbwe*"
#"*Microsoft.BingWeather*"
#"*Microsoft.MSPaint*"
#"*Microsoft.MicrosoftStickyNotes*"
#"*Microsoft.Windows.Photos*"
#"*Microsoft.WindowsCalculator*"
#"*Microsoft.WindowsStore*"
)
foreach ($Bloat in $Bloatware) {
Get-AppxPackage -Name $App | Remove-AppxPackage -ErrorAction SilentlyContinue
Get-AppxProvisionedPackage -Online | Where-Object DisplayName -like $App | Remove-AppxProvisionedPackage -Online -ErrorAction SilentlyContinue
Write-Output "Trying to remove $Bloat."
}
}
Function Remove-Keys {
Param([switch]$Debloat)
Param([switch]$DebloatAllApps, [switch]$DebloatSpecificApps)
#Creates a PSDrive to be able to access the 'HKCR' tree
New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT
@ -246,7 +318,7 @@ Function Stop-EdgePDF {
Function FixWhitelistedApps {
Param([switch]$Debloat, [switch]$SysPrep)
Param([switch]$DebloatAll, [switch]$DebloatSpecificApps, [switch]$SysPrep)
Write-Verbose -Message ('Starting Fix Whitelisted Apps')
@ -256,12 +328,13 @@ Function FixWhitelistedApps {
Get-AppxPackage -allusers Microsoft.WindowsCalculator | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
Get-AppxPackage -allusers Microsoft.WindowsStore | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
Get-AppxPackage -allusers Microsoft.Windows.Photos | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
}
}
Write-Output "Initiating Sysprep"
Begin-SysPrep
Write-Output "Removing bloatware apps."
Start-Debloat
DebloatAll
DebloatBlacklist
Write-Output "Removing leftover bloatware registry keys."
Remove-Keys
Write-Output "Checking to see if any Whitelisted Apps were removed, and if so re-adding them."

Loading…
Cancel
Save