off_telemetry_ps5.ps1 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600
  1. #Requires -RunAsAdministrator
  2. <#
  3. .SYNOPSIS
  4. Improved comprehensive script to disable telemetry in Microsoft development tools
  5. .DESCRIPTION
  6. This script safely disables telemetry, crash reporting, and data collection for:
  7. - Visual Studio 2015-2022 (only if installed)
  8. - Visual Studio Code (only if installed)
  9. - .NET CLI
  10. - NuGet
  11. - Various Visual Studio services
  12. .NOTES
  13. Must be run as Administrator
  14. Improved safety - only modifies existing registry paths
  15. Compatible with PowerShell 5.x
  16. Includes comprehensive backup and restore functionality
  17. .PARAMETER CreateBackup
  18. Creates registry backup before making changes
  19. .PARAMETER RestoreBackup
  20. Restores registry from backup file
  21. .PARAMETER BackupPath
  22. Path for backup file (default: Desktop)
  23. .EXAMPLE
  24. .\off_telemetry_ps5.ps1 -CreateBackup
  25. .\off_telemetry_ps5.ps1 -RestoreBackup -BackupPath "C:\Backup\registry_backup.reg"
  26. #>
  27. param(
  28. [switch]$CreateBackup,
  29. [switch]$RestoreBackup,
  30. [string]$BackupPath = "$env:USERPROFILE\Desktop\telemetry_backup_$(Get-Date -Format 'yyyyMMdd_HHmmss').reg"
  31. )
  32. $serviceProcessed = $false
  33. # Color scheme for consistent output
  34. $Colors = @{
  35. Title = 'Cyan'
  36. Section = 'Yellow'
  37. Success = 'Green'
  38. Info = 'Blue'
  39. Warning = 'Yellow'
  40. Error = 'Red'
  41. Gray = 'Gray'
  42. }
  43. Write-Host "=====================================-------==========" -ForegroundColor $Colors.Title
  44. Write-Host " by EXLOUD aka BOBER" -ForegroundColor $Colors.Title
  45. Write-Host "======================================================" -ForegroundColor $Colors.Title
  46. # =======================================================
  47. # BACKUP AND RESTORE FUNCTIONS
  48. # =======================================================
  49. function New-RegistryBackup {
  50. param([string]$BackupFile)
  51. Write-Host "`n--- Creating Registry Backup ---" -ForegroundColor $Colors.Section
  52. try {
  53. $backupKeys = @(
  54. "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VSCommon",
  55. "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VSCommon",
  56. "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\VisualStudio",
  57. "HKEY_CURRENT_USER\Software\Microsoft\VisualStudio"
  58. )
  59. $backupResult = $true
  60. foreach ($key in $backupKeys) {
  61. $regFile = $BackupFile -replace '\.reg$', "_$($key -replace '[\\:]', '_').reg"
  62. $null = & reg export $key $regFile /y 2>$null
  63. if ($LASTEXITCODE -eq 0) {
  64. Write-Host "✓ Backed up: $key" -ForegroundColor $Colors.Success
  65. } else {
  66. Write-Host "→ Key not found (skipped): $key" -ForegroundColor $Colors.Gray
  67. }
  68. }
  69. Write-Host "✓ Registry backup completed" -ForegroundColor $Colors.Success
  70. return $backupResult
  71. }
  72. catch {
  73. Write-Host "✗ Failed to create backup: $_" -ForegroundColor $Colors.Error
  74. return $false
  75. }
  76. }
  77. function Restore-RegistryBackup {
  78. param([string]$BackupFile)
  79. Write-Host "`n--- Restoring Registry Backup ---" -ForegroundColor $Colors.Section
  80. if (!(Test-Path $BackupFile)) {
  81. Write-Host "✗ Backup file not found: $BackupFile" -ForegroundColor $Colors.Error
  82. return $false
  83. }
  84. try {
  85. $null = & reg import $BackupFile
  86. if ($LASTEXITCODE -eq 0) {
  87. Write-Host "✓ Registry restored from: $BackupFile" -ForegroundColor $Colors.Success
  88. return $true
  89. } else {
  90. Write-Host "✗ Failed to restore registry" -ForegroundColor $Colors.Error
  91. return $false
  92. }
  93. }
  94. catch {
  95. Write-Host "✗ Error restoring backup: $_" -ForegroundColor $Colors.Error
  96. return $false
  97. }
  98. }
  99. # =======================================================
  100. # SAFE REGISTRY FUNCTIONS
  101. # =======================================================
  102. function Set-SafeRegistryValue {
  103. param(
  104. [string]$Path,
  105. [string]$Name,
  106. [object]$Value,
  107. [string]$Type = 'DWORD',
  108. [switch]$CreatePath
  109. )
  110. try {
  111. # Check if path exists
  112. if (!(Test-Path $Path)) {
  113. if ($CreatePath) {
  114. $null = New-Item -Path $Path -Force
  115. Write-Host "→ Created registry path: $Path" -ForegroundColor $Colors.Info
  116. } else {
  117. Write-Host "→ Registry path not found, skipping: $Path" -ForegroundColor $Colors.Gray
  118. return $false
  119. }
  120. } else {
  121. Write-Host "→ Found registry path: $Path" -ForegroundColor $Colors.Info
  122. }
  123. # Check current value
  124. $currentValue = Get-ItemProperty -Path $Path -Name $Name -ErrorAction SilentlyContinue
  125. if ($currentValue -and $currentValue.$Name -eq $Value) {
  126. Write-Host "✓ $Name already set to $Value" -ForegroundColor $Colors.Success
  127. return $true
  128. }
  129. # Set new value
  130. $null = New-ItemProperty -Path $Path -Name $Name -Value $Value -PropertyType $Type -Force -ErrorAction Stop
  131. Write-Host "✓ Set $Name to $Value in $Path" -ForegroundColor $Colors.Success
  132. return $true
  133. }
  134. catch {
  135. Write-Host "✗ Failed to set $Name in $Path : $_" -ForegroundColor $Colors.Error
  136. return $false
  137. }
  138. }
  139. function Remove-TelemetryDirectory {
  140. param([string]$Path)
  141. if (Test-Path $Path) {
  142. try {
  143. $itemCount = (Get-ChildItem -Path $Path -Recurse -ErrorAction SilentlyContinue | Measure-Object).Count
  144. if ($itemCount -gt 0) {
  145. Remove-Item -Path $Path -Recurse -Force -ErrorAction Stop
  146. Write-Host "✓ Removed telemetry directory: $Path ($itemCount items)" -ForegroundColor $Colors.Success
  147. } else {
  148. Write-Host "→ Telemetry directory already empty: $Path" -ForegroundColor $Colors.Info
  149. }
  150. }
  151. catch {
  152. Write-Host "✗ Failed to remove: $Path - $_" -ForegroundColor $Colors.Error
  153. }
  154. } else {
  155. Write-Host "→ Telemetry directory not found: $Path" -ForegroundColor $Colors.Gray
  156. }
  157. }
  158. function Set-SafeEnvironmentVariable {
  159. param(
  160. [string]$Name,
  161. [string]$Value,
  162. [string]$Target = 'User'
  163. )
  164. try {
  165. $currentValue = [Environment]::GetEnvironmentVariable($Name, $Target)
  166. if ($currentValue -eq $Value) {
  167. Write-Host "✓ $Name already set to $Value" -ForegroundColor $Colors.Success
  168. } else {
  169. [Environment]::SetEnvironmentVariable($Name, $Value, $Target)
  170. Write-Host "✓ Set $Name to $Value" -ForegroundColor $Colors.Success
  171. }
  172. return $true
  173. }
  174. catch {
  175. Write-Host "✗ Failed to set environment variable $Name : $_" -ForegroundColor $Colors.Error
  176. return $false
  177. }
  178. }
  179. # =======================================================
  180. # MAIN SCRIPT LOGIC
  181. # =======================================================
  182. # Handle backup/restore operations
  183. if ($RestoreBackup) {
  184. $null = Restore-RegistryBackup -BackupFile $BackupPath
  185. Write-Host "`nRestore operation completed. Press Enter to exit..." -ForegroundColor $Colors.Info
  186. $null = Read-Host
  187. exit
  188. }
  189. if ($CreateBackup) {
  190. $null = New-RegistryBackup -BackupFile $BackupPath
  191. Write-Host "`nBackup created at: $BackupPath" -ForegroundColor $Colors.Info
  192. Write-Host "You can restore with: .\off_telemetry_ps5.ps1 -RestoreBackup -BackupPath '$BackupPath'" -ForegroundColor $Colors.Info
  193. $continue = Read-Host "`nContinue with telemetry disable? (y/n)"
  194. if ($continue -ne 'y' -and $continue -ne 'Y') {
  195. exit
  196. }
  197. }
  198. # =======================================================
  199. # DETECT INSTALLED VISUAL STUDIO VERSIONS
  200. # =======================================================
  201. Write-Host "`n--- Detecting Installed Visual Studio Versions ---" -ForegroundColor $Colors.Section
  202. $vsVersions = @{
  203. "14.0" = "Visual Studio 2015"
  204. "15.0" = "Visual Studio 2017"
  205. "16.0" = "Visual Studio 2019"
  206. "17.0" = "Visual Studio 2022"
  207. }
  208. $installedVersions = @()
  209. foreach ($version in $vsVersions.Keys) {
  210. $vsName = $vsVersions[$version]
  211. # Check multiple detection methods
  212. $detected = $false
  213. # Method 1: Registry SQM paths
  214. $paths = @(
  215. "HKLM:\SOFTWARE\Microsoft\VSCommon\$version",
  216. "HKLM:\SOFTWARE\Wow6432Node\Microsoft\VSCommon\$version"
  217. )
  218. foreach ($path in $paths) {
  219. if (Test-Path $path) {
  220. $detected = $true
  221. break
  222. }
  223. }
  224. # Method 2: Installation paths
  225. if (!$detected) {
  226. $installPaths = @(
  227. "${env:ProgramFiles}\Microsoft Visual Studio\*\*\Common7\IDE\devenv.exe",
  228. "${env:ProgramFiles(x86)}\Microsoft Visual Studio\*\*\Common7\IDE\devenv.exe",
  229. "${env:ProgramFiles(x86)}\Microsoft Visual Studio $version\*\Common7\IDE\devenv.exe"
  230. )
  231. foreach ($installPath in $installPaths) {
  232. if (Get-ChildItem -Path $installPath -ErrorAction SilentlyContinue) {
  233. $detected = $true
  234. break
  235. }
  236. }
  237. }
  238. if ($detected) {
  239. Write-Host "✓ Detected: $vsName (version $version)" -ForegroundColor $Colors.Success
  240. $installedVersions += $version
  241. } else {
  242. Write-Host "→ Not found: $vsName (version $version)" -ForegroundColor $Colors.Gray
  243. }
  244. }
  245. if ($installedVersions.Count -eq 0) {
  246. Write-Host "→ No Visual Studio installations detected" -ForegroundColor $Colors.Info
  247. }
  248. # =======================================================
  249. # VISUAL STUDIO TELEMETRY DISABLE (EXISTING INSTALLATIONS ONLY)
  250. # =======================================================
  251. Write-Host "`n--- Disabling Visual Studio Telemetry (Detected Installations) ---" -ForegroundColor $Colors.Section
  252. foreach ($version in $installedVersions) {
  253. $vsName = $vsVersions[$version]
  254. Write-Host "`n--- Processing $vsName (version $version) ---" -ForegroundColor $Colors.Info
  255. # Process both architectures
  256. $regPaths = @()
  257. if ([Environment]::Is64BitOperatingSystem) {
  258. $regPaths += "HKLM:\SOFTWARE\Wow6432Node\Microsoft\VSCommon\$version\SQM"
  259. }
  260. $regPaths += "HKLM:\SOFTWARE\Microsoft\VSCommon\$version\SQM"
  261. foreach ($regPath in $regPaths) {
  262. $null = Set-SafeRegistryValue -Path $regPath -Name "OptIn" -Value 0 -Type 'DWORD'
  263. }
  264. # Additional paths for this version
  265. $additionalPaths = @(
  266. "HKCU:\Software\Microsoft\VisualStudio\$version\General"
  267. )
  268. foreach ($path in $additionalPaths) {
  269. $null = Set-SafeRegistryValue -Path $path -Name "EnableSQM" -Value 0 -Type 'DWORD'
  270. }
  271. }
  272. # =======================================================
  273. # VISUAL STUDIO POLICY SETTINGS (CONSERVATIVE APPROACH)
  274. # =======================================================
  275. Write-Host "`n--- Checking Visual Studio Policy Settings ---" -ForegroundColor $Colors.Section
  276. # Only create policy paths if at least one VS version is installed
  277. if ($installedVersions.Count -gt 0) {
  278. Write-Host "→ Visual Studio detected, configuring policies..." -ForegroundColor $Colors.Info
  279. # Policy paths (create only if VS is installed)
  280. $policyPaths = @{
  281. "HKLM:\SOFTWARE\Policies\Microsoft\VisualStudio\Feedback" = @{
  282. "DisableFeedbackDialog" = 1
  283. "DisableEmailInput" = 1
  284. "DisableScreenshotCapture" = 1
  285. }
  286. "HKLM:\SOFTWARE\Policies\Microsoft\VisualStudio\SQM" = @{
  287. "OptIn" = 0
  288. }
  289. "HKCU:\Software\Microsoft\VisualStudio\Telemetry" = @{
  290. "TurnOffSwitch" = 1
  291. }
  292. }
  293. foreach ($path in $policyPaths.Keys) {
  294. $settings = $policyPaths[$path]
  295. foreach ($setting in $settings.GetEnumerator()) {
  296. $null = Set-SafeRegistryValue -Path $path -Name $setting.Key -Value $setting.Value -Type 'DWORD' -CreatePath
  297. }
  298. }
  299. } else {
  300. Write-Host "→ No Visual Studio detected, skipping policy configuration" -ForegroundColor $Colors.Gray
  301. }
  302. # =======================================================
  303. # EXPERIENCE IMPROVEMENT PROGRAM
  304. # =======================================================
  305. Write-Host "`n--- Disabling Customer Experience Improvement Program ---" -ForegroundColor $Colors.Section
  306. $experiencePaths = @(
  307. "HKLM:\SOFTWARE\Microsoft\SQMClient",
  308. "HKLM:\SOFTWARE\Wow6432Node\Microsoft\SQMClient"
  309. )
  310. foreach ($path in $experiencePaths) {
  311. $null = Set-SafeRegistryValue -Path $path -Name "CEIPEnable" -Value 0 -Type 'DWORD'
  312. }
  313. # =======================================================
  314. # TELEMETRY DIRECTORIES CLEANUP
  315. # =======================================================
  316. Write-Host "`n--- Cleaning Telemetry Directories ---" -ForegroundColor $Colors.Section
  317. $telemetryDirs = @(
  318. "$env:APPDATA\vstelemetry",
  319. "$env:LOCALAPPDATA\Microsoft\VSApplicationInsights",
  320. "$env:PROGRAMDATA\Microsoft\VSApplicationInsights",
  321. "$env:TEMP\Microsoft\VSApplicationInsights",
  322. "$env:TEMP\VSFaultInfo",
  323. "$env:TEMP\VSFeedbackIntelliCodeLogs",
  324. "$env:TEMP\VSFeedbackPerfWatsonData",
  325. "$env:TEMP\VSFeedbackVSRTCLogs",
  326. "$env:TEMP\VSRemoteControl",
  327. "$env:TEMP\VSTelem",
  328. "$env:TEMP\VSTelem.Out"
  329. )
  330. foreach ($dir in $telemetryDirs) {
  331. Remove-TelemetryDirectory -Path $dir
  332. }
  333. # =======================================================
  334. # .NET AND NUGET TELEMETRY DISABLE
  335. # =======================================================
  336. Write-Host "`n--- Disabling .NET and NuGet Telemetry ---" -ForegroundColor $Colors.Section
  337. $null = Set-SafeEnvironmentVariable -Name 'DOTNET_CLI_TELEMETRY_OPTOUT' -Value '1' -Target 'User'
  338. $null = Set-SafeEnvironmentVariable -Name 'NUGET_TELEMETRY_OPTOUT' -Value 'true' -Target 'User'
  339. # =======================================================
  340. # VISUAL STUDIO STANDARD COLLECTOR SERVICE
  341. # =======================================================
  342. Write-Host "`n--- Managing VS Standard Collector Service ---" -ForegroundColor $Colors.Section
  343. $serviceName = 'VSStandardCollectorService150'
  344. $service = Get-Service -Name $serviceName -ErrorAction SilentlyContinue
  345. if ($service) {
  346. Write-Host "→ Found service: $serviceName" -ForegroundColor $Colors.Info
  347. # Stop service if running
  348. if ($service.Status -eq 'Running') {
  349. try {
  350. Stop-Service -Name $serviceName -Force -ErrorAction Stop
  351. Write-Host "✓ Stopped $serviceName" -ForegroundColor $Colors.Success
  352. }
  353. catch {
  354. Write-Host "✗ Could not stop $serviceName : $_" -ForegroundColor $Colors.Error
  355. }
  356. } else {
  357. Write-Host "→ Service $serviceName already stopped (Status: $($service.Status))" -ForegroundColor $Colors.Info
  358. }
  359. # Disable service
  360. if ($service.StartType -eq 'Disabled') {
  361. Write-Host "✓ $serviceName already disabled" -ForegroundColor $Colors.Success
  362. } else {
  363. try {
  364. Set-Service -Name $serviceName -StartupType Disabled -Confirm:$false -ErrorAction Stop
  365. Write-Host "✓ Disabled $serviceName" -ForegroundColor $Colors.Success
  366. }
  367. catch {
  368. Write-Host "✗ Could not disable $serviceName : $_" -ForegroundColor $Colors.Error
  369. }
  370. }
  371. } else {
  372. Write-Host "→ $serviceName not found (not installed)" -ForegroundColor $Colors.Gray
  373. }
  374. $serviceProcessed = ($null -ne $service)
  375. # =======================================================
  376. # VISUAL STUDIO CODE SETTINGS
  377. # =======================================================
  378. Write-Host "`n--- Configuring Visual Studio Code Settings ---" -ForegroundColor $Colors.Section
  379. $vscodeSettings = "$env:APPDATA\Code\User\settings.json"
  380. $vscodeUserDir = "$env:APPDATA\Code\User"
  381. $vscodeDetected = $false
  382. if (!(Test-Path "$env:APPDATA\Code")) {
  383. Write-Host "→ Visual Studio Code not detected" -ForegroundColor $Colors.Gray
  384. } else {
  385. Write-Host "→ Visual Studio Code detected" -ForegroundColor $Colors.Info
  386. $vscodeDetected = $true
  387. # Create User directory if needed
  388. if (!(Test-Path $vscodeUserDir)) {
  389. try {
  390. $null = New-Item -Path $vscodeUserDir -ItemType Directory -Force
  391. Write-Host "→ Created VS Code User directory" -ForegroundColor $Colors.Info
  392. } catch {
  393. Write-Host "✗ Failed to create VS Code User directory: $_" -ForegroundColor $Colors.Error
  394. }
  395. }
  396. # Privacy settings
  397. $privacyConfig = @{
  398. "telemetry.enableTelemetry" = $false
  399. "telemetry.enableCrashReporter" = $false
  400. "workbench.enableExperiments" = $false
  401. "update.mode" = "manual"
  402. "update.showReleaseNotes" = $false
  403. "extensions.autoCheckUpdates" = $false
  404. "extensions.showRecommendationsOnlyOnDemand" = $true
  405. "git.autofetch" = $false
  406. "npm.fetchOnlinePackageInfo" = $false
  407. }
  408. try {
  409. # Load existing settings
  410. $settings = @{}
  411. if (Test-Path $vscodeSettings) {
  412. $content = Get-Content $vscodeSettings -Raw -ErrorAction SilentlyContinue
  413. if ($content -and $content.Trim()) {
  414. try {
  415. # Use PowerShell's built-in JSON cmdlets
  416. $settingsObj = $content | ConvertFrom-Json
  417. # Convert PSCustomObject to hashtable for easier manipulation
  418. $settings = @{}
  419. $settingsObj.PSObject.Properties | ForEach-Object {
  420. $settings[$_.Name] = $_.Value
  421. }
  422. Write-Host "→ Found existing VS Code settings file" -ForegroundColor $Colors.Info
  423. }
  424. catch {
  425. Write-Host "→ Could not parse existing settings, creating new ones" -ForegroundColor $Colors.Warning
  426. $settings = @{}
  427. }
  428. }
  429. }
  430. # Update settings
  431. $changesMade = $false
  432. foreach ($key in $privacyConfig.Keys) {
  433. $value = $privacyConfig[$key]
  434. if ($settings.ContainsKey($key) -and $settings[$key] -eq $value) {
  435. Write-Host "✓ $key already set to $value" -ForegroundColor $Colors.Success
  436. } else {
  437. $settings[$key] = $value
  438. Write-Host "✓ Updated $key to $value" -ForegroundColor $Colors.Success
  439. $changesMade = $true
  440. }
  441. }
  442. # Save settings if changes were made
  443. if ($changesMade -or !(Test-Path $vscodeSettings)) {
  444. $json = $settings | ConvertTo-Json -Depth 10
  445. $json | Out-File -FilePath $vscodeSettings -Encoding UTF8
  446. Write-Host "✓ Saved VS Code privacy settings" -ForegroundColor $Colors.Success
  447. } else {
  448. Write-Host "→ No changes needed for VS Code settings" -ForegroundColor $Colors.Info
  449. }
  450. }
  451. catch {
  452. Write-Host "✗ Failed to update VS Code settings: $_" -ForegroundColor $Colors.Error
  453. }
  454. }
  455. # =======================================================
  456. # POWERSHELL TELEMETRY [off] FOR PS 7.x
  457. # =======================================================
  458. # Write-Host "`n--- Disabling PowerShell Telemetry ---" -ForegroundColor $Colors.Section
  459. # $null = Set-SafeEnvironmentVariable -Name 'POWERSHELL_TELEMETRY_OPTOUT' -Value '1' -Target 'User'
  460. # =======================================================
  461. # SUMMARY
  462. # =======================================================
  463. Write-Host "`n========================================" -ForegroundColor $Colors.Title
  464. Write-Host "TELEMETRY DISABLE COMPLETE" -ForegroundColor $Colors.Title
  465. Write-Host "========================================" -ForegroundColor $Colors.Title
  466. Write-Host "`nProcessed telemetry settings for:" -ForegroundColor White
  467. # Visual Studio versions with status colors
  468. if ($installedVersions.Count -gt 0) {
  469. foreach ($version in $installedVersions) {
  470. Write-Host "✓ " -NoNewline -ForegroundColor $Colors.Success
  471. Write-Host "$($vsVersions[$version]) (detected)" -ForegroundColor $Colors.Success
  472. }
  473. } else {
  474. Write-Host "→ " -NoNewline -ForegroundColor $Colors.Gray
  475. Write-Host "No Visual Studio versions detected" -ForegroundColor $Colors.Gray
  476. }
  477. # Visual Studio Code with status colors
  478. if ($vscodeDetected) {
  479. Write-Host "✓ " -NoNewline -ForegroundColor $Colors.Success
  480. Write-Host "Visual Studio Code (detected)" -ForegroundColor $Colors.Success
  481. } else {
  482. Write-Host "→ " -NoNewline -ForegroundColor $Colors.Gray
  483. Write-Host "Visual Studio Code (not found)" -ForegroundColor $Colors.Gray
  484. }
  485. # Other components with status indicators
  486. Write-Host "✓ " -NoNewline -ForegroundColor $Colors.Success
  487. Write-Host ".NET CLI" -ForegroundColor $Colors.Success
  488. Write-Host "✓ " -NoNewline -ForegroundColor $Colors.Success
  489. Write-Host "NuGet" -ForegroundColor $Colors.Success
  490. # VS Standard Collector Service status
  491. if ($serviceProcessed) {
  492. Write-Host "✓ " -NoNewline -ForegroundColor $Colors.Success
  493. Write-Host "VS Standard Collector Service (processed)" -ForegroundColor $Colors.Success
  494. } else {
  495. Write-Host "→ " -NoNewline -ForegroundColor $Colors.Gray
  496. Write-Host "VS Standard Collector Service (not found)" -ForegroundColor $Colors.Gray
  497. }
  498. # Write-Host "✓ " -NoNewline -ForegroundColor $Colors.Success
  499. # Write-Host "PowerShell" -ForegroundColor $Colors.Success
  500. Write-Host "✓ " -NoNewline -ForegroundColor $Colors.Success
  501. Write-Host "Customer Experience Improvement Program" -ForegroundColor $Colors.Success
  502. Write-Host "✓ " -NoNewline -ForegroundColor $Colors.Success
  503. Write-Host "Telemetry Directories Cleanup" -ForegroundColor $Colors.Success
  504. Write-Host "`nLegend:" -ForegroundColor White
  505. Write-Host "✓ " -NoNewline -ForegroundColor $Colors.Success; Write-Host "Action completed successfully"
  506. Write-Host "→ " -NoNewline -ForegroundColor $Colors.Info; Write-Host "Information or preparatory action"
  507. Write-Host "→ " -NoNewline -ForegroundColor $Colors.Gray; Write-Host "Component not found, skipped"
  508. Write-Host "✗ " -NoNewline -ForegroundColor $Colors.Error; Write-Host "Error occurred"
  509. if (!$CreateBackup) {
  510. Write-Host "`nTip: Run with -CreateBackup parameter to create registry backup first" -ForegroundColor $Colors.Warning
  511. }
  512. Write-Host "`nRestart may be required for all changes to take effect." -ForegroundColor $Colors.Warning
  513. Write-Host "Press Enter to exit..." -ForegroundColor White
  514. $null = Read-Host