mirror of
https://github.com/gnh1201/welsonjs.git
synced 2026-01-30 21:19:26 +00:00
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.
This commit is contained in:
parent
9fe110b6ac
commit
ec7553b538
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user