diff --git a/PowerShellEditorServices.Common.props b/PowerShellEditorServices.Common.props
index 2f07fcc7f..d9679732e 100644
--- a/PowerShellEditorServices.Common.props
+++ b/PowerShellEditorServices.Common.props
@@ -9,6 +9,5 @@
git
https://github.com/PowerShell/PowerShellEditorServices
portable
- 1.0.3
diff --git a/src/PowerShellEditorServices/Session/PowerShell3Operations.cs b/src/PowerShellEditorServices/Session/PowerShell3Operations.cs
index 2199e1839..047944359 100644
--- a/src/PowerShellEditorServices/Session/PowerShell3Operations.cs
+++ b/src/PowerShellEditorServices/Session/PowerShell3Operations.cs
@@ -6,11 +6,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using System.Management.Automation;
using System.Management.Automation.Runspaces;
namespace Microsoft.PowerShell.EditorServices.Session
{
+ using System.Management.Automation;
+
internal class PowerShell3Operations : IVersionSpecificOperations
{
public void ConfigureDebugger(Runspace runspace)
@@ -32,27 +33,11 @@ public IEnumerable ExecuteCommandInDebugger(
out DebuggerResumeAction? debuggerResumeAction)
{
IEnumerable executionResult = null;
-
- using (var nestedPipeline = currentRunspace.CreateNestedPipeline())
+ using (var pwsh = PowerShell.Create())
{
- foreach (var command in psCommand.Commands)
- {
- nestedPipeline.Commands.Add(command);
- }
-
- var results = nestedPipeline.Invoke();
-
- if (typeof(TResult) != typeof(PSObject))
- {
- executionResult =
- results
- .Select(pso => pso.BaseObject)
- .Cast();
- }
- else
- {
- executionResult = results.Cast();
- }
+ pwsh.Runspace = currentRunspace;
+ pwsh.Commands = psCommand;
+ executionResult = pwsh.Invoke();
}
// Write the output to the host if necessary
diff --git a/src/PowerShellEditorServices/Session/PowerShellContext.cs b/src/PowerShellEditorServices/Session/PowerShellContext.cs
index f8d6e69a3..5ae22c03e 100644
--- a/src/PowerShellEditorServices/Session/PowerShellContext.cs
+++ b/src/PowerShellEditorServices/Session/PowerShellContext.cs
@@ -823,44 +823,11 @@ await this.ExecuteCommand