File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
internal/buildscripts/packaging/msi Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -57,6 +57,23 @@ for ( $i = 0; $i -lt $args.count; $i++ ) {
57
57
}
58
58
}
59
59
60
+ # ######################################
61
+ # Extracts the environment variables configured for the splunk-otel-collector service
62
+ # and sets them in the current PowerShell session. This is useful to directly run the
63
+ # collector from the PowerShell console. This is not required for the support bundle.
64
+ # - GLOBALS: None
65
+ # - ARGUMENTS: None
66
+ # - OUTPUTS: None
67
+ # - RETURN: None
68
+ # ######################################
69
+ function setCurrentEnvironmentForManualRun () {
70
+ $env_array = Get-ItemPropertyValue - Path " HKLM:\SYSTEM\CurrentControlSet\Services\splunk-otel-collector" - Name " Environment"
71
+ foreach ($entry in $env_array ) {
72
+ $key , $value = $entry.Split (" =" , 2 )
73
+ [Environment ]::SetEnvironmentVariable($key , $value )
74
+ }
75
+ }
76
+
60
77
# ######################################
61
78
# Creates a unique temporary directory to store the contents of the support
62
79
# bundle. Do not attempt to cleanup to prevent any accidental deletions.
You can’t perform that action at this time.
0 commit comments