From 785c903229ecfb6a1bfaf244d421c94b92b8f4e2 Mon Sep 17 00:00:00 2001 From: Sydney Smith <43417619+SydneyhSmith@users.noreply.github.com> Date: Tue, 14 Jan 2020 08:10:56 -0800 Subject: [PATCH 1/7] Update StartEditorServicesCommand.cs --- .../Commands/StartEditorServicesCommand.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/PowerShellEditorServices.Hosting/Commands/StartEditorServicesCommand.cs b/src/PowerShellEditorServices.Hosting/Commands/StartEditorServicesCommand.cs index 0630c33f1..8ef127a32 100644 --- a/src/PowerShellEditorServices.Hosting/Commands/StartEditorServicesCommand.cs +++ b/src/PowerShellEditorServices.Hosting/Commands/StartEditorServicesCommand.cs @@ -278,6 +278,12 @@ private void StartLogging() _logger.Log(PsesLogLevel.Diagnostic, "Logging started"); } + + private void SetDistributionChannel() + { + //Sets the distribution channel to PSES so starts can be distinguished in PS7+ telemetry + Environment.SetEnvironmentVariable("POWERSHELL_DISTRIBUTION_CHANNEL", "PSES"); + } private string GetLogDirPath() { From 9c475ff7ca7e71920a5a126dfec151719519aeb2 Mon Sep 17 00:00:00 2001 From: Sydney Smith <43417619+SydneyhSmith@users.noreply.github.com> Date: Tue, 14 Jan 2020 08:29:11 -0800 Subject: [PATCH 2/7] Update StartEditorServicesCommand.cs --- .../Commands/StartEditorServicesCommand.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/PowerShellEditorServices.Hosting/Commands/StartEditorServicesCommand.cs b/src/PowerShellEditorServices.Hosting/Commands/StartEditorServicesCommand.cs index 8ef127a32..3edff06ca 100644 --- a/src/PowerShellEditorServices.Hosting/Commands/StartEditorServicesCommand.cs +++ b/src/PowerShellEditorServices.Hosting/Commands/StartEditorServicesCommand.cs @@ -215,6 +215,8 @@ protected override void EndProcessing() // Create the configuration from parameters EditorServicesConfig editorServicesConfig = CreateConfigObject(); + // Set the Environment Var + SetDistributionChannel(); var sessionFileWriter = new SessionFileWriter(_logger, SessionDetailsPath); _logger.Log(PsesLogLevel.Diagnostic, "Session file writer created"); From 1f894322296b3233c6773ac83572270beea045f5 Mon Sep 17 00:00:00 2001 From: Sydney Smith <43417619+SydneyhSmith@users.noreply.github.com> Date: Tue, 14 Jan 2020 08:33:45 -0800 Subject: [PATCH 3/7] Update StartEditorServicesCommand.cs --- .../Commands/StartEditorServicesCommand.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/PowerShellEditorServices.Hosting/Commands/StartEditorServicesCommand.cs b/src/PowerShellEditorServices.Hosting/Commands/StartEditorServicesCommand.cs index 3edff06ca..8504f5809 100644 --- a/src/PowerShellEditorServices.Hosting/Commands/StartEditorServicesCommand.cs +++ b/src/PowerShellEditorServices.Hosting/Commands/StartEditorServicesCommand.cs @@ -40,6 +40,7 @@ public StartEditorServicesCommand() { _disposableResources = new List(); _loggerUnsubscribers = new List(); + SetDistributionChannel(); } /// @@ -215,8 +216,6 @@ protected override void EndProcessing() // Create the configuration from parameters EditorServicesConfig editorServicesConfig = CreateConfigObject(); - // Set the Environment Var - SetDistributionChannel(); var sessionFileWriter = new SessionFileWriter(_logger, SessionDetailsPath); _logger.Log(PsesLogLevel.Diagnostic, "Session file writer created"); @@ -281,7 +280,7 @@ private void StartLogging() _logger.Log(PsesLogLevel.Diagnostic, "Logging started"); } - private void SetDistributionChannel() + private static SetDistributionChannel() { //Sets the distribution channel to PSES so starts can be distinguished in PS7+ telemetry Environment.SetEnvironmentVariable("POWERSHELL_DISTRIBUTION_CHANNEL", "PSES"); From b9c62631dcb7ce9d5da3625709902263007d61ed Mon Sep 17 00:00:00 2001 From: Sydney Smith <43417619+SydneyhSmith@users.noreply.github.com> Date: Tue, 14 Jan 2020 08:40:24 -0800 Subject: [PATCH 4/7] Update StartEditorServicesCommand.cs --- .../Commands/StartEditorServicesCommand.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PowerShellEditorServices.Hosting/Commands/StartEditorServicesCommand.cs b/src/PowerShellEditorServices.Hosting/Commands/StartEditorServicesCommand.cs index 8504f5809..c3ae487d0 100644 --- a/src/PowerShellEditorServices.Hosting/Commands/StartEditorServicesCommand.cs +++ b/src/PowerShellEditorServices.Hosting/Commands/StartEditorServicesCommand.cs @@ -38,9 +38,9 @@ public sealed class StartEditorServicesCommand : PSCmdlet public StartEditorServicesCommand() { + SetDistributionChannel(); _disposableResources = new List(); _loggerUnsubscribers = new List(); - SetDistributionChannel(); } /// From e880733030f8bf39193af91ff72f41b3f0117194 Mon Sep 17 00:00:00 2001 From: Sydney Smith <43417619+SydneyhSmith@users.noreply.github.com> Date: Tue, 14 Jan 2020 08:50:04 -0800 Subject: [PATCH 5/7] Update src/PowerShellEditorServices.Hosting/Commands/StartEditorServicesCommand.cs Co-Authored-By: Tyler James Leonhardt --- .../Commands/StartEditorServicesCommand.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PowerShellEditorServices.Hosting/Commands/StartEditorServicesCommand.cs b/src/PowerShellEditorServices.Hosting/Commands/StartEditorServicesCommand.cs index c3ae487d0..22ff68ef8 100644 --- a/src/PowerShellEditorServices.Hosting/Commands/StartEditorServicesCommand.cs +++ b/src/PowerShellEditorServices.Hosting/Commands/StartEditorServicesCommand.cs @@ -280,7 +280,7 @@ private void StartLogging() _logger.Log(PsesLogLevel.Diagnostic, "Logging started"); } - private static SetDistributionChannel() + private static void SetDistributionChannel() { //Sets the distribution channel to PSES so starts can be distinguished in PS7+ telemetry Environment.SetEnvironmentVariable("POWERSHELL_DISTRIBUTION_CHANNEL", "PSES"); From 33c2e35684c7137e4ee68ade6707e39ece1053bc Mon Sep 17 00:00:00 2001 From: Sydney Smith <43417619+SydneyhSmith@users.noreply.github.com> Date: Tue, 14 Jan 2020 10:52:12 -0800 Subject: [PATCH 6/7] Update StartEditorServicesCommand.cs --- .../Commands/StartEditorServicesCommand.cs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/PowerShellEditorServices.Hosting/Commands/StartEditorServicesCommand.cs b/src/PowerShellEditorServices.Hosting/Commands/StartEditorServicesCommand.cs index 22ff68ef8..18ee6328f 100644 --- a/src/PowerShellEditorServices.Hosting/Commands/StartEditorServicesCommand.cs +++ b/src/PowerShellEditorServices.Hosting/Commands/StartEditorServicesCommand.cs @@ -38,7 +38,7 @@ public sealed class StartEditorServicesCommand : PSCmdlet public StartEditorServicesCommand() { - SetDistributionChannel(); + Environment.SetEnvironmentVariable("POWERSHELL_DISTRIBUTION_CHANNEL", "PSES"); _disposableResources = new List(); _loggerUnsubscribers = new List(); } @@ -279,12 +279,6 @@ private void StartLogging() _logger.Log(PsesLogLevel.Diagnostic, "Logging started"); } - - private static void SetDistributionChannel() - { - //Sets the distribution channel to PSES so starts can be distinguished in PS7+ telemetry - Environment.SetEnvironmentVariable("POWERSHELL_DISTRIBUTION_CHANNEL", "PSES"); - } private string GetLogDirPath() { From ea47ae315c4eae97de8266ff81bba9e3a6430143 Mon Sep 17 00:00:00 2001 From: Sydney Smith <43417619+SydneyhSmith@users.noreply.github.com> Date: Tue, 14 Jan 2020 10:58:17 -0800 Subject: [PATCH 7/7] Update src/PowerShellEditorServices.Hosting/Commands/StartEditorServicesCommand.cs Co-Authored-By: Tyler James Leonhardt --- .../Commands/StartEditorServicesCommand.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/PowerShellEditorServices.Hosting/Commands/StartEditorServicesCommand.cs b/src/PowerShellEditorServices.Hosting/Commands/StartEditorServicesCommand.cs index 18ee6328f..f12bbc905 100644 --- a/src/PowerShellEditorServices.Hosting/Commands/StartEditorServicesCommand.cs +++ b/src/PowerShellEditorServices.Hosting/Commands/StartEditorServicesCommand.cs @@ -38,6 +38,7 @@ public sealed class StartEditorServicesCommand : PSCmdlet public StartEditorServicesCommand() { + //Sets the distribution channel to "PSES" so starts can be distinguished in PS7+ telemetry Environment.SetEnvironmentVariable("POWERSHELL_DISTRIBUTION_CHANNEL", "PSES"); _disposableResources = new List(); _loggerUnsubscribers = new List();