From 01b3fda8658f0f9b0c9e6c322f577ca5d43d4084 Mon Sep 17 00:00:00 2001 From: Tyler Leonhardt Date: Mon, 27 Jan 2020 15:35:04 -0800 Subject: [PATCH 1/2] run profile paths together --- .../Services/PowerShellContext/PowerShellContextService.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/PowerShellEditorServices/Services/PowerShellContext/PowerShellContextService.cs b/src/PowerShellEditorServices/Services/PowerShellContext/PowerShellContextService.cs index 6780b019a..14ee40f78 100644 --- a/src/PowerShellEditorServices/Services/PowerShellContext/PowerShellContextService.cs +++ b/src/PowerShellEditorServices/Services/PowerShellContext/PowerShellContextService.cs @@ -1161,12 +1161,12 @@ public async Task LoadHostProfilesAsync() if (this.profilePaths != null) { // Load any of the profile paths that exist + var command = new PSCommand(); foreach (var profilePath in GetLoadableProfilePaths(this.profilePaths)) { - PSCommand command = new PSCommand(); - command.AddCommand(profilePath, false); - await this.ExecuteCommandAsync(command, sendOutputToHost: true, sendErrorToHost: true).ConfigureAwait(false); + command.AddCommand(profilePath, false).AddStatement(); } + await ExecuteCommandAsync(command, sendOutputToHost: true, sendErrorToHost: true).ConfigureAwait(false); // Gather the session details (particularly the prompt) after // loading the user's profiles. From 4b5698aebdc36d7f76b68dbd2556fb71db88d610 Mon Sep 17 00:00:00 2001 From: Tyler Leonhardt Date: Mon, 27 Jan 2020 15:40:12 -0800 Subject: [PATCH 2/2] codacy --- .../Services/PowerShellContext/PowerShellContextService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PowerShellEditorServices/Services/PowerShellContext/PowerShellContextService.cs b/src/PowerShellEditorServices/Services/PowerShellContext/PowerShellContextService.cs index 14ee40f78..599453546 100644 --- a/src/PowerShellEditorServices/Services/PowerShellContext/PowerShellContextService.cs +++ b/src/PowerShellEditorServices/Services/PowerShellContext/PowerShellContextService.cs @@ -1166,7 +1166,7 @@ public async Task LoadHostProfilesAsync() { command.AddCommand(profilePath, false).AddStatement(); } - await ExecuteCommandAsync(command, sendOutputToHost: true, sendErrorToHost: true).ConfigureAwait(false); + await ExecuteCommandAsync(command, sendOutputToHost: true).ConfigureAwait(false); // Gather the session details (particularly the prompt) after // loading the user's profiles.