Silently don't set execution policy for Unix machines (#3481)

This commit is contained in:
Travis Plunk 2017-04-04 16:53:36 -07:00 committed by Dongbo Wang
parent 2d8d59e4e0
commit 8de8b19505

View file

@ -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