Skip to content

Instantly share code, notes, and snippets.

@eabase
Last active August 21, 2025 22:19
Show Gist options
  • Save eabase/dc409e95c0c3bd3168711a914a1b4c02 to your computer and use it in GitHub Desktop.
Save eabase/dc409e95c0c3bd3168711a914a1b4c02 to your computer and use it in GitHub Desktop.
List of Windows-11 Telemetry that can be disabled using environment variables
Tool/Service Environment Variable Effect
PowerShell POWERSHELL_TELEMETRY_OPTOUT=1 Disables telemetry sent to Application Insights
.NET CLI / SDK DOTNET_CLI_TELEMETRY_OPTOUT=1 Prevents sending usage data (commands/ errors/ etc.)
VCPKG VCPKG_DISABLE_METRICS=1 Disables anonymous usage metrics
Azure CLI AZURE_CORE_COLLECT_TELEMETRY=0 Stops Azure CLI from sending usage data
Visual Studio Code VSCODE_TELEMETRY_DISABLE=1 Disables telemetry in VS Code
Visual Studio Code VSCODE_CRASH_REPORTER_DISABLE=1 Disables crash reporting
GitHub CLI GH_NO_TELEMETRY=1 Prevents GitHub CLI from sending telemetry
Application Insights SDK APPLICATIONINSIGHTS_NO_DIAGNOSTIC_CHANNEL=1 Disables diagnostic channel used for telemetry
Windows Terminal N/A No known environment variable; telemetry controlled via settings.json
Windows Feedback Hub N/A No environment variable; disable via Group Policy or uninstall
@eabase
Copy link
Author

eabase commented Aug 15, 2025

Here's a powershell to run the list and add it permanently as a SYSTEM (Machine) environment varaible.

#!/usr/bin/env pwsh
# disable_telemtry.ps1 - Disables common Windows Telemetry privacy invaders

# Requires admin privileges to set system-wide environment variables

# Define telemetry environment variable settings with inline comments
$telemetrySettings = @{
    "POWERSHELL_TELEMETRY_OPTOUT"               = "1"  # Disables telemetry sent by PowerShell to Application Insights
    "DOTNET_CLI_TELEMETRY_OPTOUT"               = "1"  # Prevents .NET CLI and SDK from sending usage data (commands, errors, etc.)
    "VCPKG_DISABLE_METRICS"                     = "1"  # Disables anonymous usage metrics collected by the VCPKG package manager
    "AZURE_CORE_COLLECT_TELEMETRY"              = "0"  # Stops Azure CLI from sending telemetry data about command usage and errors
    "VSCODE_TELEMETRY_DISABLE"                  = "1"  # Disables usage telemetry in Visual Studio Code
    "VSCODE_CRASH_REPORTER_DISABLE"             = "1"  # Disables crash reporting in Visual Studio Code
    "GH_NO_TELEMETRY"                           = "1"  # Prevents GitHub CLI from sending telemetry data
    "APPLICATIONINSIGHTS_NO_DIAGNOSTIC_CHANNEL" = "1"  # Disables the diagnostic channel used by Application Insights SDK
}

Write-Host -f DarkYellow "`nPermanently Disabling Telemetry for common Windows tools and utilities."
Write-Host -f Red "NOTE: Only telemetry controlled by an environment variable are considered."
pause

# Loop through each setting and apply it system-wide
foreach ($key in $telemetrySettings.Keys) {
    $value = $telemetrySettings[$key]
    [Environment]::SetEnvironmentVariable($key, $value, "Machine")
    Write-Host -f DarkGray "Disabling: " -Non;  Write-Host -f Green "$key = $value"
}
Write-Host -f DarkYellow "`nDone`n"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment