From 8de8b19505b337e2d1ca00f97ce58d8c7fa5a8e5 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Tue, 4 Apr 2017 16:53:36 -0700 Subject: [PATCH] Silently don't set execution policy for Unix machines (#3481) --- src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHost.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHost.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHost.cs index 0d780dfabb..b26dfae3ba 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHost.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHost.cs @@ -1398,6 +1398,7 @@ namespace Microsoft.PowerShell ui.ThrowOnReadAndPrompt = cpp.ThrowOnReadAndPrompt; _noExit = cpp.NoExit; +#if !UNIX // See if we need to change the process-wide execution // policy if (!String.IsNullOrEmpty(cpp.ExecutionPolicy)) @@ -1405,6 +1406,7 @@ namespace Microsoft.PowerShell ExecutionPolicy executionPolicy = SecuritySupport.ParseExecutionPolicy(cpp.ExecutionPolicy); SecuritySupport.SetExecutionPolicy(ExecutionPolicyScope.Process, executionPolicy, null); } +#endif // NTRAID#Windows Out Of Band Releases-915506-2005/09/09 // Removed HandleUnexpectedExceptions infrastructure