|
|
@@ -1,47 +1,66 @@
|
|
1
|
|
-@echo off
|
|
2
|
|
-
|
|
3
|
|
-if (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator"))
|
|
4
|
|
-{
|
|
5
|
|
- Start-Process PowerShell.exe "-NoProfile -ExecutionPolicy Bypass -Command [System.Diagnostics.Process]::Start((New-Object System.Diagnostics.ProcessStartInfo \"$PSCommandPath\",\"-Verb runAs\"))"
|
|
6
|
|
- exit
|
|
7
|
|
-}
|
|
8
|
|
-
|
|
9
|
|
-rem Disable Windows services
|
|
10
|
|
-sc config diagtrack start= disabled
|
|
11
|
|
-
|
|
12
|
|
-REM 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
|
|
-
|
|
25
|
|
-rem Disable AMD and NVIDIA telemetry
|
|
26
|
|
-sc config AMD Telemetry Client start= disabled
|
|
27
|
|
-sc config NVTelemetryContainer start= disabled
|
|
28
|
|
-sc config IntelTelemetryService start= disabled
|
|
29
|
|
-
|
|
30
|
|
-rem Disable Windows telemetry
|
|
31
|
|
-reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\DataCollection" /v AllowTelemetry /t REG_DWORD /d 0 /f
|
|
32
|
|
-
|
|
33
|
|
-rem Uninstall Smartbyte and its associated telemetry
|
|
34
|
|
-msiexec.exe /x {A0CDAD3D-0329-4E3E-8DC1-30E333D6564D} /quiet
|
|
35
|
|
-
|
|
36
|
|
-Invoke-WebRequest -Uri "https://github.com/microsoft/winget-cli/releases/download/v0.3.1170/Microsoft.Windows.Winget.Client.0.3.1170.msix" -OutFile "winget.msix"
|
|
37
|
|
-Start-Process "msixbundle.exe" -ArgumentList "install", "winget.msix" -Wait
|
|
38
|
|
-
|
|
39
|
|
-Write-Host "Winget has been installed successfully."
|
|
40
|
|
-Write-Host "Press any key to continue."
|
|
41
|
|
-
|
|
42
|
|
-$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
|
|
43
|
|
-
|
|
44
|
|
-rem Upgrade all installed Windows programs
|
|
45
|
|
-for /f "delims=" %a in ('winget list --installed') do winget upgrade %a
|
|
46
|
|
-
|
|
47
|
|
-pause
|
|
|
1
|
+@echo off
|
|
|
2
|
+
|
|
|
3
|
+if (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator"))
|
|
|
4
|
+{
|
|
|
5
|
+ Start-Process PowerShell.exe "-NoProfile -ExecutionPolicy Bypass -Command [System.Diagnostics.Process]::Start((New-Object System.Diagnostics.ProcessStartInfo \"$PSCommandPath\",\"-Verb runAs\"))"
|
|
|
6
|
+ exit
|
|
|
7
|
+}
|
|
|
8
|
+
|
|
|
9
|
+
|
|
|
10
|
+# Disable Windows services
|
|
|
11
|
+Set-Service -Name "DiagTrack" -StartupType Disabled
|
|
|
12
|
+Stop-Service -Name "DiagTrack"
|
|
|
13
|
+
|
|
|
14
|
+# Uninstall Smartbyte and its associated telemetry
|
|
|
15
|
+msiexec.exe /x {A0CDAD3D-0329-4E3E-8DC1-30E333D6564D} /quiet
|
|
|
16
|
+
|
|
|
17
|
+# Remove other built-in apps
|
|
|
18
|
+Get-AppxPackage *Microsoft.3DBuilder* | Remove-AppxPackage
|
|
|
19
|
+Get-AppxPackage *Microsoft.BingWeather* | Remove-AppxPackage
|
|
|
20
|
+Get-AppxPackage *Microsoft.Getstarted* | Remove-AppxPackage
|
|
|
21
|
+Get-AppxPackage *Microsoft.MicrosoftSolitaireCollection* | Remove-AppxPackage
|
|
|
22
|
+Get-AppxPackage *Microsoft.MicrosoftStickyNotes* | Remove-AppxPackage
|
|
|
23
|
+Get-AppxPackage *Microsoft.Office.OneNote* | Remove-AppxPackage
|
|
|
24
|
+Get-AppxPackage *Microsoft.People* | Remove-AppxPackage
|
|
|
25
|
+Get-AppxPackage *Microsoft.SkypeApp* | Remove-AppxPackage
|
|
|
26
|
+Get-AppxPackage *Microsoft.XboxApp* | Remove-AppxPackage
|
|
|
27
|
+Get-AppxPackage *Microsoft.ZuneMusic* | Remove-AppxPackage
|
|
|
28
|
+Get-AppxPackage *Microsoft.ZuneVideo* | Remove-AppxPackage
|
|
|
29
|
+
|
|
|
30
|
+# Install Google Chrome
|
|
|
31
|
+$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"
|
|
|
32
|
+
|
|
|
33
|
+Invoke-WebRequest $Chrome -OutFile "$env:temp\ChromeStandaloneSetup64.exe"
|
|
|
34
|
+
|
|
|
35
|
+Start-Process "$env:temp\ChromeStandaloneSetup64.exe" -ArgumentList '/silent /install' -Wait
|
|
|
36
|
+
|
|
|
37
|
+# Install Firefox
|
|
|
38
|
+$Firefox = "https://download.mozilla.org/?product=firefox-latest&os=win64&lang=en-US"
|
|
|
39
|
+
|
|
|
40
|
+Invoke-WebRequest $Firefox -OutFile "$env:temp\FirefoxSetup.exe"
|
|
|
41
|
+
|
|
|
42
|
+Start-Process "$env:temp\FirefoxSetup.exe" -ArgumentList '/S' -Wait
|
|
|
43
|
+
|
|
|
44
|
+# Install Ublock Origin extension in Chrome
|
|
|
45
|
+$UblockOriginChrome = "https://chrome.google.com/webstore/detail/ublock-origin/cjpalhdlnbpafiamejdnhcphjbkeiagm"
|
|
|
46
|
+Start-Process "Google Chrome" -ArgumentList $UblockOriginChrome
|
|
|
47
|
+
|
|
|
48
|
+# Install Ublock Origin extension in Firefox
|
|
|
49
|
+$UblockOriginFirefox = "https://addons.mozilla.org/en-US/firefox/addon/ublock-origin/"
|
|
|
50
|
+Start-Process "Firefox" -ArgumentList $UblockOriginFirefox
|
|
|
51
|
+
|
|
|
52
|
+# Install Ublock Origin extension in Edge
|
|
|
53
|
+$UblockOriginEdge = "https://microsoftedge.microsoft.com/addons/detail/cjpalhdlnbpafiamejdnhcphjbkeiagm"
|
|
|
54
|
+Start-Process "MicrosoftEdge" -ArgumentList $UblockOriginEdge
|
|
|
55
|
+
|
|
|
56
|
+# Disable Windows and driver telemetry
|
|
|
57
|
+Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection" -Name "AllowTelemetry" -Type DWORD -Value 0 -Force
|
|
|
58
|
+
|
|
|
59
|
+# Add registry key for PlatformAoAcOverride
|
|
|
60
|
+$registryPath = "HKLM:\SYSTEM\CurrentControlSet\Control\Power"
|
|
|
61
|
+New-Item -Path "$registryPath" -Name "PlatformAoAcOverride" -Force | Out-Null
|
|
|
62
|
+New-ItemProperty -Path "$registryPath" -Name "PlatformAoAcOverride" -Value 0 -PropertyType DWORD
|
|
|
63
|
+
|
|
|
64
|
+# Disable BitLocker services
|
|
|
65
|
+Stop-Service -Name "BDESVC"
|
|
|
66
|
+Set-Service -Name "BDESVC" -StartupType "Disabled"
|