Skip to content

Commit

Permalink
Silently don't set execution policy for Unix machines (PowerShell#3481)
Browse files Browse the repository at this point in the history
  • Loading branch information
TravisEz13 authored and daxian-dbw committed Apr 4, 2017
1 parent 2d8d59e commit 8de8b19
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1398,13 +1398,15 @@ private uint Run(CommandLineParameterParser cpp, bool isPrestartWarned)
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))
{
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
Expand Down

0 comments on commit 8de8b19

Please sign in to comment.