Brak opisu

DebloatWindowsTEST2.ps1 3.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. @echo off
  2. if (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator"))
  3. {
  4. Start-Process PowerShell.exe "-NoProfile -ExecutionPolicy Bypass -Command [System.Diagnostics.Process]::Start((New-Object System.Diagnostics.ProcessStartInfo \"$PSCommandPath\",\"-Verb runAs\"))"
  5. exit
  6. }
  7. # Disable Windows services
  8. Set-Service -Name "DiagTrack" -StartupType Disabled
  9. Stop-Service -Name "DiagTrack"
  10. # Uninstall Smartbyte and its associated telemetry
  11. msiexec.exe /x {A0CDAD3D-0329-4E3E-8DC1-30E333D6564D} /quiet
  12. # Remove other built-in apps
  13. Get-AppxPackage *Microsoft.3DBuilder* | Remove-AppxPackage
  14. Get-AppxPackage *Microsoft.BingWeather* | Remove-AppxPackage
  15. Get-AppxPackage *Microsoft.Getstarted* | Remove-AppxPackage
  16. Get-AppxPackage *Microsoft.MicrosoftSolitaireCollection* | Remove-AppxPackage
  17. Get-AppxPackage *Microsoft.MicrosoftStickyNotes* | Remove-AppxPackage
  18. Get-AppxPackage *Microsoft.Office.OneNote* | Remove-AppxPackage
  19. Get-AppxPackage *Microsoft.People* | Remove-AppxPackage
  20. Get-AppxPackage *Microsoft.SkypeApp* | Remove-AppxPackage
  21. Get-AppxPackage *Microsoft.XboxApp* | Remove-AppxPackage
  22. Get-AppxPackage *Microsoft.ZuneMusic* | Remove-AppxPackage
  23. Get-AppxPackage *Microsoft.ZuneVideo* | Remove-AppxPackage
  24. # Install Google Chrome
  25. $Chrome = "https://dl.google.com/tag/s/appguid%3D%7B8A69D345-D564-463C-AFF1-A69D9E530F96%7D%26iid%3D%7B957D5128-B19B-45A8-A0DD-EE6B5862CAD9%7D%26lang%3Den%26browser%3D4%26usagestats%3D0%26appname%3DGoogle%2520Chrome%26needsadmin%3Dprefers%26ap%3Dx64-stable-statsdef_1%26installdataindex%3Dempty/update2/installers/ChromeStandaloneSetup64.exe"
  26. Invoke-WebRequest $Chrome -OutFile "$env:temp\ChromeStandaloneSetup64.exe"
  27. Start-Process "$env:temp\ChromeStandaloneSetup64.exe" -ArgumentList '/silent /install' -Wait
  28. # Install Firefox
  29. $Firefox = "https://download.mozilla.org/?product=firefox-latest&os=win64&lang=en-US"
  30. Invoke-WebRequest $Firefox -OutFile "$env:temp\FirefoxSetup.exe"
  31. Start-Process "$env:temp\FirefoxSetup.exe" -ArgumentList '/S' -Wait
  32. # Install Ublock Origin extension in Chrome
  33. $UblockOriginChrome = "https://chrome.google.com/webstore/detail/ublock-origin/cjpalhdlnbpafiamejdnhcphjbkeiagm"
  34. Start-Process "Google Chrome" -ArgumentList $UblockOriginChrome
  35. # Install Ublock Origin extension in Firefox
  36. $UblockOriginFirefox = "https://addons.mozilla.org/en-US/firefox/addon/ublock-origin/"
  37. Start-Process "Firefox" -ArgumentList $UblockOriginFirefox
  38. # Install Ublock Origin extension in Edge
  39. $UblockOriginEdge = "https://microsoftedge.microsoft.com/addons/detail/cjpalhdlnbpafiamejdnhcphjbkeiagm"
  40. Start-Process "MicrosoftEdge" -ArgumentList $UblockOriginEdge
  41. # Disable Windows and driver telemetry
  42. Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection" -Name "AllowTelemetry" -Type DWORD -Value 0 -Force
  43. # Add registry key for PlatformAoAcOverride
  44. $registryPath = "HKLM:\SYSTEM\CurrentControlSet\Control\Power"
  45. New-Item -Path "$registryPath" -Name "PlatformAoAcOverride" -Force | Out-Null
  46. New-ItemProperty -Path "$registryPath" -Name "PlatformAoAcOverride" -Value 0 -PropertyType DWORD
  47. # Disable BitLocker services
  48. Stop-Service -Name "BDESVC"
  49. Set-Service -Name "BDESVC" -StartupType "Disabled"

Powered by TurnKey Linux.