Исходный код СУБД RuDB — свободной СУБД с открытым исходным кодом на базе PostgreSQL
rudb
3 days ago bd039d1e92813358c5c5a1e346b49074baf513f2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
param([switch]$DisableTelemetry)
 
# The first part of the expression in the following "if" statement is necessary, otherwise it will report an error,
# "You cannot call a method on a null-valued expression.", when the env variable does not exist.
if ($DisableTelemetry) {
    Write-Host "##vso[task.setvariable variable=TelemetryOption]--no_telemetry"
    Write-Host "Telemetry is disabled."
} elseif (-not [string]::IsNullOrEmpty( $Env:TELEMETRYGUID) -and $Env:TELEMETRYGUID.StartsWith('"')) {
    $length = $Env:TELEMETRYGUID.length
    # See https://learn.microsoft.com/en-us/windows/win32/api/traceloggingprovider/nf-traceloggingprovider-traceloggingoptiongroup
    # The value of the env variable must have quotes, because we do not add the quotes here.
    $fileContent = "#define TraceLoggingOptionMicrosoftTelemetry() \
      TraceLoggingOptionGroup("+$Env:TELEMETRYGUID.substring(1, $length-2)+")"
    New-Item -Path "include\onnxruntime\core\platform\windows\TraceLoggingConfigPrivate.h" -ItemType "file" -Value "$fileContent" -Force
    Write-Host "##vso[task.setvariable variable=TelemetryOption]--use_windows_telemetry"
    Write-Host "UTC telemetry is enabled."
} else {
    Write-Host "##vso[task.setvariable variable=TelemetryOption]"
    Write-Host "1DS telemetry is enabled."
}