function Show-Menu { Clear-Host Write-Host "=== Windows 10 Optimization Menu ===" -ForegroundColor Cyan Write-Host "1. Disable Xbox Services" Write-Host "2. Disable Cortana" Write-Host "3. Uninstall OneDrive" Write-Host "4. Disable Error Reporting (WerSvc)" Write-Host "5. Disable Remote Registry & Remote Desktop Services" Write-Host "6. Disable Windows Update (Manual control)" Write-Host "7. Apply All Optimizations" Write-Host "0. Exit" Write-Host "" } function Disable-ServiceSafe { param([string]$name) if (Get-Service -Name $name -ErrorAction SilentlyContinue) { Stop-Service $name -Force -ErrorAction SilentlyContinue Set-Service $name -StartupType Disabled Write-Host "✔ Disabled $name" } else { Write-Host "✘ Service $name not found" } } function Option1 { Disable-ServiceSafe "XboxGipSvc" Disable-ServiceSafe "XboxNetApiSvc" } function Option2 { Write-Host "Cortana disabling is limited via script. Please disable via Group Policy or third-party tools." } function Option3 { Start-Process "cmd.exe" "/c taskkill /f /im OneDrive.exe & %SystemRoot%\System32\OneDriveSetup.exe /uninstall" -Verb RunAs Write-Host "✔ OneDrive uninstall command issued" } function Option4 { Disable-ServiceSafe "WerSvc" } function Option5 { Disable-ServiceSafe "RemoteRegistry" Disable-ServiceSafe "TermService" } function Option6 { Disable-ServiceSafe "wuauserv" } function OptionAll { Option1 Option3 Option4 Option5 Option6 Write-Host "✔ All optimizations applied" } do { Show-Menu $choice = Read-Host "Choose an option" switch ($choice) { "1" { Option1 } "2" { Option2 } "3" { Option3 } "4" { Option4 } "5" { Option5 } "6" { Option6 } "7" { OptionAll } "0" { break } default { Write-Host "Invalid option." } } Pause } while ($choice -ne "0")