From ec7553b538efaa136d6773abd8f1a550edee1193 Mon Sep 17 00:00:00 2001 From: "Namhyeon, Go" Date: Sat, 20 Dec 2025 20:06:06 +0900 Subject: [PATCH] Use script filename as telemetry source Replaces the hardcoded 'source' field in the telemetry payload with the actual script filename, improving accuracy in identifying the script sending telemetry events. --- postInstall.ps1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/postInstall.ps1 b/postInstall.ps1 index d6d1792..9db5827 100644 --- a/postInstall.ps1 +++ b/postInstall.ps1 @@ -137,6 +137,8 @@ if ($TelemetryProvider -and $TelemetryProvider.ToLower() -eq "posthog") { } if ($finalDistinctId -and $finalDistinctId.Trim() -ne "") { + # Get current script file name + $scriptName = Split-Path $PSCommandPath -Leaf # Build single event payload for PostHog /i/v0/e endpoint $body = @{ @@ -147,7 +149,7 @@ if ($TelemetryProvider -and $TelemetryProvider.ToLower() -eq "posthog") { product = "welsonjs" version = $Version os = "windows" - source = "post-install.ps1" + source = $scriptName components = $Components # Keep raw string here } timestamp = (Get-Date).ToString("o") # ISO 8601 format