From aeabd5aa53f2f765480dbe8cf900be43ae5dbf65 Mon Sep 17 00:00:00 2001 From: George Fleming Date: Thu, 5 Nov 2015 08:21:33 -0800 Subject: [PATCH] Fix for history --- src/host/main.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/host/main.cs b/src/host/main.cs index 23ec9cd3cd..929cb02839 100644 --- a/src/host/main.cs +++ b/src/host/main.cs @@ -250,13 +250,15 @@ namespace Microsoft.Samples.PowerShell.Host // If there is any input pass it in, otherwise just invoke the // the pipeline. + PSInvocationSettings settings = new PSInvocationSettings(); + settings.AddToHistory = true; if (input != null) { - this.currentPowerShell.Invoke(new object[] { input }); + this.currentPowerShell.Invoke(new object[] { input }, settings); } else { - this.currentPowerShell.Invoke(); + this.currentPowerShell.Invoke(null, settings); } } finally