mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 12:45:47 +00:00
Integrate changes from SD between [SD:715912] and [SD:717473]
This commit is contained in:
1 parent
dfea5de391
commit
207d2b3195
23 files changed
+279
-259
No files matched your search
@@ -463,10 +463,6 @@ namespace Microsoft.PowerShell
|
||||
if (!noexitSeen)
|
||||
showBanner = false;
|
||||
|
||||
// Exit on script completion unless -noexit was specified...
|
||||
if (!noexitSeen)
|
||||
noExit = false;
|
||||
|
||||
// Process interactive input...
|
||||
if (args[i] == "-")
|
||||
{
|
||||
@@ -477,6 +473,10 @@ namespace Microsoft.PowerShell
|
||||
}
|
||||
else
|
||||
{
|
||||
// Exit on script completion unless -noexit was specified...
|
||||
if (!noexitSeen)
|
||||
noExit = false;
|
||||
|
||||
// We need to get the full path to the script because it will be
|
||||
// executed after the profiles are run and they may change the current
|
||||
// directory.
|
||||
@@ -877,10 +877,9 @@ namespace Microsoft.PowerShell
|
||||
commandLineCommand = cmdLineCmdSB.ToString();
|
||||
}
|
||||
|
||||
if (!noexitSeen)
|
||||
if (!noexitSeen && !explicitReadCommandsFromStdin)
|
||||
{
|
||||
// don't reset this if they've already specified -noexit
|
||||
|
||||
noExit = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -1360,7 +1360,7 @@ namespace Microsoft.PowerShell
|
||||
inputFormat = cpp.InputFormat;
|
||||
wasInitialCommandEncoded = cpp.WasInitialCommandEncoded;
|
||||
|
||||
ui.ReadFromStdin = cpp.ExplicitReadCommandsFromStdin || (Console.IsInputRedirected && !cpp.NonInteractive);
|
||||
ui.ReadFromStdin = cpp.ExplicitReadCommandsFromStdin || Console.IsInputRedirected;
|
||||
ui.NoPrompt = cpp.NoPrompt;
|
||||
ui.ThrowOnReadAndPrompt = cpp.ThrowOnReadAndPrompt;
|
||||
noExit = cpp.NoExit;
|
||||
@@ -1421,7 +1421,7 @@ namespace Microsoft.PowerShell
|
||||
|
||||
if (ExitCode == ExitCodeInitFailure) { break; }
|
||||
|
||||
if (!noExit && (!ui.ReadFromStdin || Console.In.Peek() == -1))
|
||||
if (!noExit)
|
||||
{
|
||||
// Wait for runspace to open, init, and run init script before
|
||||
// setting ShouldEndSession, to allow debugger to work.
|
||||
@@ -2452,14 +2452,8 @@ namespace Microsoft.PowerShell
|
||||
if (Console.IsInputRedirected)
|
||||
{
|
||||
// null is also the result of reading stdin to EOF.
|
||||
|
||||
if (!parent.noExit)
|
||||
{
|
||||
parent.ShouldEndSession = true;
|
||||
break;
|
||||
}
|
||||
|
||||
ui.ReadFromStdin = false;
|
||||
parent.ShouldEndSession = true;
|
||||
break;
|
||||
}
|
||||
|
||||
continue;
|
||||
|
||||
@@ -233,7 +233,7 @@ namespace Microsoft.PowerShell.Commands
|
||||
|
||||
System.Management.Automation.Remoting.PSSenderInfo psSenderInfo =
|
||||
this.SessionState.PSVariable.GetValue("PSSenderInfo") as System.Management.Automation.Remoting.PSSenderInfo;
|
||||
Host.UI.StartTranscribing(effectiveFilePath, psSenderInfo, IncludeInvocationHeader.ToBool(), this.Context.CurrentRunspace.InstanceId);
|
||||
Host.UI.StartTranscribing(effectiveFilePath, psSenderInfo, IncludeInvocationHeader.ToBool());
|
||||
|
||||
// ch.StartTranscribing(effectiveFilePath, Append);
|
||||
|
||||
@@ -249,7 +249,7 @@ namespace Microsoft.PowerShell.Commands
|
||||
{
|
||||
try
|
||||
{
|
||||
Host.UI.StopTranscribing(this.Context.CurrentRunspace.InstanceId);
|
||||
Host.UI.StopTranscribing();
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace Microsoft.PowerShell.Commands
|
||||
{
|
||||
try
|
||||
{
|
||||
string outFilename = Host.UI.StopTranscribing(this.Context.CurrentRunspace.InstanceId);
|
||||
string outFilename = Host.UI.StopTranscribing();
|
||||
if (outFilename != null)
|
||||
{
|
||||
PSObject outputObject = new PSObject(
|
||||
|
||||
Reference in new issue
Block a user