diff options
| author | srdusr <trevorgray@srdusr.com> | 2024-06-05 20:04:43 +0200 |
|---|---|---|
| committer | srdusr <trevorgray@srdusr.com> | 2024-06-05 20:04:43 +0200 |
| commit | ff5adb12e6d41dc2e8f375ec111d2ebd090d8609 (patch) | |
| tree | 22e9725c2af141ab5cb251502f00c6c4bd598499 | |
| parent | 773ddca9e98b6aa580872aa3b82cc6f999e35510 (diff) | |
| download | dotfiles-ff5adb12e6d41dc2e8f375ec111d2ebd090d8609.tar.gz dotfiles-ff5adb12e6d41dc2e8f375ec111d2ebd090d8609.zip | |
Changed name to bloatware
| -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" |
