Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -527,16 +527,12 @@ private void InitNativeProcess()
ProcessStartInfo startInfo = GetProcessStartInfo(redirectOutput, redirectError, redirectInput, soloCommand);

#if !UNIX
string commandPath = this.Path.ToLowerInvariant();
if (commandPath.EndsWith("powershell.exe") || commandPath.EndsWith("powershell_ise.exe"))
{
// if starting Windows PowerShell, need to remove PowerShell specific segments of PSModulePath
string psmodulepath = ModuleIntrinsics.GetWindowsPowerShellModulePath();
startInfo.Environment["PSModulePath"] = psmodulepath;
// if starting Windows PowerShell, need to remove PowerShell specific segments of PSModulePath
string psmodulepath = ModuleIntrinsics.GetWindowsPowerShellModulePath();
startInfo.Environment["PSModulePath"] = psmodulepath;

// must set UseShellExecute to false if we modify the environment block
startInfo.UseShellExecute = false;
}
// must set UseShellExecute to false if we modify the environment block
startInfo.UseShellExecute = false;
#endif

if (this.Command.Context.CurrentPipelineStopping)
Expand Down