Skip to content

EXLOUD/Visual-Studio-Telemetry-Disable-Tool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

29 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ‘‡

Download My Script


Visual Studio Telemetry Disable Tool

๐Ÿ‘€ Repository Views

count

โญ If this tool helped you, please consider giving it a star! โญ


PowerShell License Windows

Preview

A comprehensive PowerShell-based tool to disable telemetry and data collection across Microsoft development tools including Visual Studio, Visual Studio Code, .NET CLI, and NuGet.

๐Ÿš€ Features

  • Comprehensive Coverage: Disables telemetry for Visual Studio 2015-2022, VS Code, .NET CLI, and NuGet
  • Backup & Restore: Create registry backups before making changes and restore when needed
  • Smart Detection: Only modifies existing registry paths - doesn't create unnecessary entries
  • PowerShell 7 Optimized: Enhanced performance and modern PowerShell features
  • Administrator Safety: Requires admin privileges and validates permissions
  • Cross-Version Support: Works with PowerShell 5.1 and 7.0+
  • Detailed Logging: Color-coded output with comprehensive status reporting

๐Ÿ“‹ What Gets Disabled

Visual Studio (2015-2022)

  • Customer Experience Improvement Program (CEIP)
  • Feedback dialogs and crash reporting
  • Automatic data collection
  • VS Standard Collector Service

Visual Studio Code

  • Telemetry reporting
  • Crash reporter
  • Automatic experiments
  • Extension auto-updates
  • Usage analytics

.NET CLI & NuGet

  • .NET CLI telemetry collection
  • NuGet package usage analytics
  • Performance data collection

System-Wide

  • Windows SQM (Software Quality Metrics) Client
  • Application Insights data collection
  • Telemetry directories cleanup

๐Ÿ› ๏ธ Prerequisites

  • Windows operating system
  • Administrator privileges
  • PowerShell 5.1 or PowerShell 7.0+

๐Ÿ“ฆ Installation

  1. Download the tool:

    git clone https://github.com/your-username/vs-telemetry-disable.git
    cd vs-telemetry-disable
  2. Or download as ZIP:

    • Click "Code" โ†’ "Download ZIP"
    • Extract to your desired location

๐Ÿš€ Usage

Quick Start

  1. Right-click on Launcher.bat and select "Run as administrator"
  2. Follow the interactive prompts
  3. The launcher will automatically detect your PowerShell version and run the appropriate script

Command Line Usage

Basic Usage (Disable telemetry)

# PowerShell 7
.\script\off_telemetry_ps7.ps1

# PowerShell 5
.\script\off_telemetry_ps5.ps1

Create Backup First (Recommended)

# Create backup before making changes
.\script\off_telemetry_ps7.ps1 -CreateBackup

# Create backup to specific location
.\script\off_telemetry_ps7.ps1 -CreateBackup -BackupPath "C:\MyBackups\telemetry_backup.reg"

Restore from Backup

# Restore from default backup location
.\script\off_telemetry_ps7.ps1 -RestoreBackup -BackupPath "path\to\your\backup.reg"

Advanced Usage Examples

# Create backup and continue with telemetry disable
.\script\off_telemetry_ps7.ps1 -CreateBackup

# Restore specific backup file
.\script\off_telemetry_ps7.ps1 -RestoreBackup -BackupPath "C:\Backups\telemetry_backup_20241201_143022.reg"

# Create backup to custom location without running disable
.\script\off_telemetry_ps7.ps1 -CreateBackup -BackupPath "D:\MyBackups\vs_telemetry.reg"

๐Ÿ“ Project Structure

vs-telemetry-disable/
โ”œโ”€โ”€ Launcher.bat              # Interactive launcher script
โ”œโ”€โ”€ assets/
โ”‚   โ””โ”€โ”€ preview.gif           # Tool demonstration
โ”œโ”€โ”€ script/
โ”‚   โ”œโ”€โ”€ off_telemetry_ps7.ps1 # PowerShell 7.0+ version
โ”‚   โ””โ”€โ”€ off_telemetry_ps5.ps1 # PowerShell 5.1 version
โ”œโ”€โ”€ README.md                 # This file
โ”œโ”€โ”€ LICENSE                   # MIT License
โ””โ”€โ”€ .gitignore               # Git ignore rules

๐Ÿ”ง How It Works

Detection Process

  1. PowerShell Version Detection: Launcher automatically detects available PowerShell versions
  2. Registry Path Validation: Only existing registry paths are modified
  3. Service Management: Safely stops and disables telemetry services
  4. Environment Variables: Sets opt-out environment variables
  5. File Cleanup: Removes existing telemetry data directories

Registry Modifications

The tool modifies the following registry areas (only if they exist):

  • HKLM:\SOFTWARE\Microsoft\VSCommon\*\SQM
  • HKLM:\SOFTWARE\Policies\Microsoft\VisualStudio
  • HKCU:\Software\Microsoft\VisualStudio
  • HKLM:\SOFTWARE\Microsoft\SQMClient

Environment Variables Set

  • DOTNET_CLI_TELEMETRY_OPTOUT=1
  • NUGET_TELEMETRY_OPTOUT=true
  • POWERSHELL_TELEMETRY_OPTOUT=1

โš ๏ธ Important Notes

  • Administrator Rights Required: The script must run with administrator privileges
  • Backup Recommended: Always create a backup before making changes
  • Restart Required: Some changes may require a system restart to take full effect
  • Existing Paths Only: The script only modifies existing registry entries
  • VS Code Settings: Creates/updates VS Code settings.json with privacy-focused configuration

๐Ÿ”„ Backup & Restore

Creating Backups

# Default backup location (Desktop with timestamp)
.\script\off_telemetry_ps7.ps1 -CreateBackup

# Custom backup location
.\script\off_telemetry_ps7.ps1 -CreateBackup -BackupPath "C:\Backups\my_backup.reg"

Restoring Backups

# Restore from backup
.\script\off_telemetry_ps7.ps1 -RestoreBackup -BackupPath "path\to\backup.reg"

Backup files are standard Windows Registry (.reg) files that can be imported manually if needed.

๐Ÿ†˜ Troubleshooting

Common Issues

"This script must be run as Administrator"

  • Right-click the batch file and select "Run as administrator"
  • Or run PowerShell as administrator and execute the script directly

"PowerShell script not found"

  • Ensure the script folder contains the PowerShell files
  • Check that file paths are correct

"No compatible PowerShell version found"

  • Install PowerShell 7 (recommended) or ensure Windows PowerShell 5.1 is available

Verification

To verify the changes worked:

  1. Check environment variables in a new command prompt
  2. Look for disabled services in Services.msc
  3. Check VS Code settings.json for updated privacy settings
  4. Review registry entries (if comfortable with registry editing)

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

Development Setup

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Test on both PowerShell 5.1 and 7.0+
  5. Commit your changes (git commit -m 'Add amazing feature')
  6. Push to the branch (git push origin feature/amazing-feature)
  7. Open a Pull Request

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

โšก Author

EXLOUD

๐Ÿ™ Acknowledgments

  • Microsoft for providing comprehensive documentation on registry settings
  • PowerShell community for best practices and patterns
  • Contributors and users who provide feedback and improvements

๐Ÿ“Š Compatibility

Component Status Notes
Visual Studio 2015 โœ… Supported If installed
Visual Studio 2017 โœ… Supported If installed
Visual Studio 2019 โœ… Supported If installed
Visual Studio 2022 โœ… Supported If installed
Visual Studio Code โœ… Supported If installed
.NET CLI โœ… Supported Always processed
NuGet โœ… Supported Always processed
PowerShell 5.1 โœ… Supported Windows PowerShell
PowerShell 7.0+ โœ… Supported Recommended

๐Ÿ”ฎ Roadmap

  • GUI interface for easier usage
  • Support for additional Microsoft development tools
  • Scheduled telemetry cleanup
  • Configuration profiles for different scenarios
  • Integration with package managers

โญ If this tool helped you, please consider giving it a star!

Releases

No releases published

Packages

No packages published