diff --git a/src/Microsoft.PowerShell.Linux.Host/readline.cs b/src/Microsoft.PowerShell.Linux.Host/readline.cs index d69ebd457c..7a2df6a234 100644 --- a/src/Microsoft.PowerShell.Linux.Host/readline.cs +++ b/src/Microsoft.PowerShell.Linux.Host/readline.cs @@ -499,21 +499,12 @@ namespace Microsoft.PowerShell.Linux.Host /// private void GetHistory(bool nested) { - if (nested) + using (Pipeline pipeline = nested + ? this.powershell.Runspace.CreateNestedPipeline("Get-History", true) + : this.powershell.Runspace.CreatePipeline("Get-History")) { - using (Pipeline pipelineNested = this.powershell.Runspace.CreateNestedPipeline("Get-History", true)) - { - historyResult = pipelineNested.Invoke(); - } + historyResult = pipeline.Invoke(); } - else - { - using (Pipeline pipeline = this.powershell.Runspace.CreatePipeline("Get-History")) - { - historyResult = pipeline.Invoke(); - } - } - } ///