Skip to content

Instantly share code, notes, and snippets.

#Requires -RunAsAdministrator
# Disable telemetry in Visual Studio 2022 - https://learn.microsoft.com/en-us/visualstudio/ide/visual-studio-experience-improvement-program?view=vs-2022
New-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\VSCommon\17.0\SQM" -Name "OptIn" -Value "0" -PropertyType "DWORD" -Force
# Delete telemetry directories
Remove-Item -Path "$env:APPDATA\vstelemetry" -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item -Path "$env:LOCALAPPDATA\Microsoft\VSApplicationInsights" -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item -Path "$env:PROGRAMDATA\Microsoft\VSApplicationInsights" -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item -Path "$env:TEMP\Microsoft\VSApplicationInsights" -Recurse -Force -ErrorAction SilentlyContinue