diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleControl.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleControl.cs
index 71804e87ce..cc385c1ee7 100644
--- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleControl.cs
+++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleControl.cs
@@ -1,4 +1,4 @@
-#if !OPEN
+#if !PORTABLE
/********************************************************************++
Copyright (c) Microsoft Corporation. All rights reserved.
--********************************************************************/
diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHost.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHost.cs
index 66c4aa8d32..3b7f69e662 100644
--- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHost.cs
+++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHost.cs
@@ -197,7 +197,7 @@ namespace Microsoft.PowerShell
System.Threading.Thread.CurrentThread.Name = "ConsoleHost main thread";
theConsoleHost = ConsoleHost.CreateSingletonInstance(configuration);
-#if !OPEN
+#if !PORTABLE
theConsoleHost.BindBreakHandler();
#endif
@@ -277,7 +277,7 @@ namespace Microsoft.PowerShell
-#if !OPEN
+#if !PORTABLE
///
///
/// The break handler for the program. Dispatches a break event to the current Executor.
@@ -436,7 +436,7 @@ namespace Microsoft.PowerShell
// call the console APIs directly, instead of ui.rawui.FlushInputHandle, as ui may be finalized
// already if this thread is lagging behind the main thread.
-#if !OPEN
+#if !PORTABLE
ConsoleHandle handle = ConsoleControl.GetInputHandle();
ConsoleControl.FlushConsoleInputBuffer(handle);
#endif
@@ -1032,7 +1032,7 @@ namespace Microsoft.PowerShell
#endif
}
-#if !OPEN
+#if !PORTABLE
private void BindBreakHandler()
{
breakHandlerGcHandle = GCHandle.Alloc(new ConsoleControl.BreakHandler(MyBreakHandler));
@@ -1091,7 +1091,7 @@ namespace Microsoft.PowerShell
{
if (!isDisposed)
{
-#if !OPEN
+#if !PORTABLE
Dbg.Assert(breakHandlerGcHandle != null, "break handler should be set");
ConsoleControl.RemoveBreakHandler();
breakHandlerGcHandle.Free();
@@ -2849,7 +2849,7 @@ namespace Microsoft.PowerShell
///
private RunspaceRef runspaceRef;
-#if !OPEN
+#if !PORTABLE
private GCHandle breakHandlerGcHandle;
#endif
private System.Threading.Thread breakHandlerThread;
diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostRawUserInterface.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostRawUserInterface.cs
index 888f454ded..3334357812 100644
--- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostRawUserInterface.cs
+++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostRawUserInterface.cs
@@ -1,4 +1,4 @@
-#if !OPEN
+#if !PORTABLE
/********************************************************************++
Copyright (c) Microsoft Corporation. All rights reserved.
--********************************************************************/
diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterface.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterface.cs
index 7106b101f8..218f4e535a 100644
--- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterface.cs
+++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterface.cs
@@ -14,7 +14,7 @@ using System.Management.Automation.Internal;
using System.Management.Automation.Host;
using System.Security;
using Dbg = System.Management.Automation.Diagnostics;
-#if !OPEN
+#if !PORTABLE
using ConsoleHandle = Microsoft.Win32.SafeHandles.SafeFileHandle;
#endif
@@ -62,7 +62,7 @@ namespace Microsoft.PowerShell
this.rawui = new ConsoleHostRawUserInterface(this);
isInteractiveTestToolListening = false;
-#if OPEN
+#if PORTABLE
this._supportsVirtualTerminal = false;
#else
// Turn on virtual terminal if possible.
@@ -278,7 +278,7 @@ namespace Microsoft.PowerShell
private object ReadLineSafe(bool isSecureString, char? printToken)
{
-#if OPEN
+#if PORTABLE
throw new PlatformNotSupportedException("Cannot read secure strings!");
#else
// Don't lock (instanceLock) in here -- the caller needs to do that...
@@ -404,7 +404,7 @@ namespace Microsoft.PowerShell
#endif
}
-#if !OPEN
+#if !PORTABLE
///
///
@@ -553,7 +553,7 @@ namespace Microsoft.PowerShell
internal void WriteToConsole(string value, bool transcribeResult)
{
-#if !OPEN
+#if !PORTABLE
ConsoleHandle handle = ConsoleControl.GetActiveScreenBufferHandle();
// Ensure that we're in the proper line-output mode. We don't lock here as it does not matter if we
@@ -576,7 +576,7 @@ namespace Microsoft.PowerShell
// This is atomic, so we don't lock here...
-#if !OPEN
+#if !PORTABLE
ConsoleControl.WriteConsole(handle, value);
#else
Console.Out.Write(value);
@@ -1624,7 +1624,7 @@ namespace Microsoft.PowerShell
private string ReadLineFromConsole(bool endOnTab, string initialContent, bool calledFromPipeline, ref string restOfLine, ref ReadLineResult result)
{
-#if OPEN
+#if PORTABLE
return ReadLineFromFile(initialContent);
#else
@@ -1759,7 +1759,7 @@ namespace Microsoft.PowerShell
///
/// the cursor position where 'tab' is hit
///
-#if !OPEN
+#if !PORTABLE
private char GetCharacterUnderCursor(Coordinates cursorPosition)
{
Rectangle region = new Rectangle(0, cursorPosition.Y, RawUI.BufferSize.Width - 1, cursorPosition.Y);
@@ -1956,7 +1956,7 @@ namespace Microsoft.PowerShell
if (restOfLine != string.Empty)
{
lastCompletion = completedInput.Remove(completedInput.Length - restOfLine.Length);
-#if !OPEN
+#if !PORTABLE
SendLeftArrows(restOfLine.Length);
#endif
}
@@ -1982,7 +1982,7 @@ namespace Microsoft.PowerShell
return input;
}
-#if !OPEN
+#if !PORTABLE
private void SendLeftArrows(int length)
{
var inputs = new ConsoleControl.INPUT[length * 2];
diff --git a/src/Microsoft.PowerShell.ConsoleHost/project.json b/src/Microsoft.PowerShell.ConsoleHost/project.json
index babf345d0c..d4e1d0b7b6 100644
--- a/src/Microsoft.PowerShell.ConsoleHost/project.json
+++ b/src/Microsoft.PowerShell.ConsoleHost/project.json
@@ -25,7 +25,7 @@
"netstandard1.5": {
"imports": [ "dnxcore50", "portable-net45+win8" ],
"compilationOptions": {
- "define": [ "CORECLR", "OPEN" ]
+ "define": [ "CORECLR", "PORTABLE" ]
},
"dependencies": {
"Newtonsoft.Json": "8.0.2",
diff --git a/src/Microsoft.PowerShell.ConsoleHost/singleshell/installer/EngineInstaller.cs b/src/Microsoft.PowerShell.ConsoleHost/singleshell/installer/EngineInstaller.cs
index 260c56229d..3e7971855f 100644
--- a/src/Microsoft.PowerShell.ConsoleHost/singleshell/installer/EngineInstaller.cs
+++ b/src/Microsoft.PowerShell.ConsoleHost/singleshell/installer/EngineInstaller.cs
@@ -1,4 +1,4 @@
-#if !OPEN
+#if !PORTABLE
/********************************************************************++
Copyright (c) Microsoft Corporation. All rights reserved.
--********************************************************************/
diff --git a/src/Microsoft.PowerShell.ConsoleHost/singleshell/installer/MshHostMshSnapin.cs b/src/Microsoft.PowerShell.ConsoleHost/singleshell/installer/MshHostMshSnapin.cs
index 07fc481bf0..0b9a0f65e2 100644
--- a/src/Microsoft.PowerShell.ConsoleHost/singleshell/installer/MshHostMshSnapin.cs
+++ b/src/Microsoft.PowerShell.ConsoleHost/singleshell/installer/MshHostMshSnapin.cs
@@ -1,4 +1,4 @@
-#if !OPEN
+#if !PORTABLE
/********************************************************************++
Copyright (c) Microsoft Corporation. All rights reserved.
--********************************************************************/