aboutsummaryrefslogtreecommitdiff
path: root/.config/powershell
diff options
context:
space:
mode:
Diffstat (limited to '.config/powershell')
-rw-r--r--.config/powershell/bloatware.ps1 (renamed from .config/powershell/onedrive.ps1)53
1 files changed, 52 insertions, 1 deletions
diff --git a/.config/powershell/onedrive.ps1 b/.config/powershell/bloatware.ps1
index b935130..833f7c7 100644
--- a/.config/powershell/onedrive.ps1
+++ b/.config/powershell/bloatware.ps1
@@ -1,4 +1,4 @@
-# onedrive.ps1
+# bloatware.ps1
# Helper functions ------------------------
function force-mkdir($path) {
@@ -8,6 +8,57 @@ function force-mkdir($path) {
}
}
+$bloatware = @(
+ #"Anytime"
+ "BioEnrollment"
+ #"Browser"
+ "ContactSupport"
+ "Cortana"
+ #"Defender"
+ "Feedback"
+ "Flash"
+ #"Gaming" # Breaks Xbox Live Account Login
+ #"Holo"
+ #"InternetExplorer"
+ "Maps"
+ #"MiracastView"
+ "OneDrive"
+ #"SecHealthUI"
+ "Wallet"
+ #"Xbox" # Causes a bootloop since upgrade 1511?
+)
+
+# Remove Features ------------------------
+foreach ($bloat in $bloatware) {
+ Write-Output "Removing packages containing $bloat"
+ $pkgs = (Get-ChildItem "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\Packages" |
+ Where-Object Name -Like "*$bloat*")
+
+ foreach ($pkg in $pkgs) {
+ $pkgname = $pkg.Name.split('\')[-1]
+ Takeown-Registry($pkg.Name)
+ Takeown-Registry($pkg.Name + "\Owners")
+ Set-ItemProperty -Path ("HKLM:" + $pkg.Name.Substring(18)) -Name Visibility -Value 1
+ New-ItemProperty -Path ("HKLM:" + $pkg.Name.Substring(18)) -Name DefVis -PropertyType DWord -Value 2
+ Remove-Item -Path ("HKLM:" + $pkg.Name.Substring(18) + "\Owners")
+ dism.exe /Online /Remove-Package /PackageName:$pkgname /NoRestart
+ }
+}
+
+# Remove default apps and bloat ------------------------
+Write-Output "Uninstalling default apps"
+foreach ($app in $apps) {
+ Write-Output "Trying to remove $app"
+ Get-AppxPackage -Name $app -AllUsers | Remove-AppxPackage -AllUsers
+ Get-AppXProvisionedPackage -Online |
+ Where-Object DisplayName -EQ $app |
+ Remove-AppxProvisionedPackage -Online
+}
+
+# Prevents "Suggested Applications" returning
+force-mkdir "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Cloud Content"
+Set-ItemProperty "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Cloud Content" "DisableWindowsConsumerFeatures" 1
+
# Kill OneDrive with fire ------------------------
Write-Output "Kill OneDrive process"
taskkill.exe /F /IM "OneDrive.exe"