1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- @echo off
-
- if (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator"))
- {
- Start-Process PowerShell.exe "-NoProfile -ExecutionPolicy Bypass -Command [System.Diagnostics.Process]::Start((New-Object System.Diagnostics.ProcessStartInfo \"$PSCommandPath\",\"-Verb runAs\"))"
- exit
- }
-
- rem Disable Windows services
- sc config diagtrack start= disabled
-
- REM Remove other built-in apps
- Get-AppxPackage *Microsoft.3DBuilder* | Remove-AppxPackage
- Get-AppxPackage *Microsoft.BingWeather* | Remove-AppxPackage
- Get-AppxPackage *Microsoft.Getstarted* | Remove-AppxPackage
- Get-AppxPackage *Microsoft.MicrosoftSolitaireCollection* | Remove-AppxPackage
- Get-AppxPackage *Microsoft.MicrosoftStickyNotes* | Remove-AppxPackage
- Get-AppxPackage *Microsoft.Office.OneNote* | Remove-AppxPackage
- Get-AppxPackage *Microsoft.People* | Remove-AppxPackage
- Get-AppxPackage *Microsoft.SkypeApp* | Remove-AppxPackage
- Get-AppxPackage *Microsoft.XboxApp* | Remove-AppxPackage
- Get-AppxPackage *Microsoft.ZuneMusic* | Remove-AppxPackage
- Get-AppxPackage *Microsoft.ZuneVideo* | Remove-AppxPackage
-
- rem Disable AMD and NVIDIA telemetry
- sc config AMD Telemetry Client start= disabled
- sc config NVTelemetryContainer start= disabled
- sc config IntelTelemetryService start= disabled
-
- rem Disable Windows telemetry
- reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\DataCollection" /v AllowTelemetry /t REG_DWORD /d 0 /f
-
- rem Uninstall Smartbyte and its associated telemetry
- msiexec.exe /x {A0CDAD3D-0329-4E3E-8DC1-30E333D6564D} /quiet
-
- 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"
- Start-Process "msixbundle.exe" -ArgumentList "install", "winget.msix" -Wait
-
- Write-Host "Winget has been installed successfully."
- Write-Host "Press any key to continue."
-
- $null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
-
- rem Upgrade all installed Windows programs
- for /f "delims=" %a in ('winget list --installed') do winget upgrade %a
-
- pause
|