@@ -168,6 +168,7 @@ function createTempDir {
168
168
New-Item - Path $TMPDIR / logs - ItemType Directory | Out-Null
169
169
New-Item - Path $TMPDIR / logs/ td- agent - ItemType Directory | Out-Null
170
170
New-Item - Path $TMPDIR / metrics - ItemType Directory | Out-Null
171
+ New-Item - Path $TMPDIR / msi - ItemType Directory | Out-Null
171
172
New-Item - Path $TMPDIR / zpages - ItemType Directory | Out-Null
172
173
# We can not create directory using special characters like : , ?
173
174
# So we have encoded it and then created new directory.
@@ -293,6 +294,21 @@ function getMetrics {
293
294
}
294
295
}
295
296
297
+ # ######################################
298
+ # Gather zpages
299
+ # - GLOBALS: TMPDIR
300
+ # - ARGUMENTS: None
301
+ # - OUTPUTS: None
302
+ # - RETURN: 0
303
+ # ######################################
304
+ function getMsiInfo {
305
+ Write-Output " INFO: Getting MSI information..."
306
+ Get-ItemProperty ' HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\*\Products\*\InstallProperties' `
307
+ | Where-Object { $_.DisplayName -eq " Splunk OpenTelemetry Collector" } > $TMPDIR / msi/ user- installs.txt 2>&1
308
+ Get-ItemProperty ' HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*' `
309
+ | Where-Object { $_.DisplayName -eq " Splunk OpenTelemetry Collector" } > $TMPDIR / msi/ uninstall-info .txt 2>&1
310
+ }
311
+
296
312
# ######################################
297
313
# Gather zpages
298
314
# - GLOBALS: TMPDIR
@@ -375,6 +391,7 @@ $(getConfig) 2>&1 | Tee-Object -FilePath "$TMPDIR/stdout.log" -Append
375
391
$ (getStatus) 2>&1 | Tee-Object - FilePath " $TMPDIR /stdout.log" - Append
376
392
$ (getLogs) 2>&1 | Tee-Object - FilePath " $TMPDIR /stdout.log" - Append
377
393
$ (getMetrics) 2>&1 | Tee-Object - FilePath " $TMPDIR /stdout.log" - Append
394
+ $ (getMsiInfo) 2>&1 | Tee-Object - FilePath " $TMPDIR /stdout.log" - Append
378
395
$ (getZpages) 2>&1 | Tee-Object - FilePath " $TMPDIR /stdout.log" - Append
379
396
$ (getHostInfo) 2>&1 | Tee-Object - FilePath " $TMPDIR /stdout.log" - Append
380
397
$ (getServiceEnvironment(" $TMPDIR /config/service_environment.txt" )) 2>&1 `
0 commit comments