Skip to content

Commit 88ba3f6

Browse files
authored
Use the same temporary home directory when 'HOME' env variable is not set (PowerShell#16263)
1 parent 7bb8fa1 commit 88ba3f6

7 files changed

Lines changed: 105 additions & 256 deletions

File tree

src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHost.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
using System.Management.Automation.Internal;
1717
using System.Management.Automation.Language;
1818
using System.Management.Automation.Remoting;
19+
using System.Management.Automation.Remoting.Server;
1920
using System.Management.Automation.Runspaces;
2021
using System.Management.Automation.Tracing;
2122
using System.Reflection;
@@ -193,7 +194,7 @@ internal static int Start(string bannerText, string helpText)
193194
{
194195
ApplicationInsightsTelemetry.SendPSCoreStartupTelemetry("ServerMode");
195196
ProfileOptimization.StartProfile("StartupProfileData-ServerMode");
196-
System.Management.Automation.Remoting.Server.StdIOProcessMediator.Run(
197+
StdIOProcessMediator.Run(
197198
initialCommand: s_cpp.InitialCommand,
198199
workingDirectory: s_cpp.WorkingDirectory,
199200
configurationName: null);
@@ -203,7 +204,7 @@ internal static int Start(string bannerText, string helpText)
203204
{
204205
ApplicationInsightsTelemetry.SendPSCoreStartupTelemetry("SSHServer");
205206
ProfileOptimization.StartProfile("StartupProfileData-SSHServerMode");
206-
System.Management.Automation.Remoting.Server.StdIOProcessMediator.Run(
207+
StdIOProcessMediator.Run(
207208
initialCommand: s_cpp.InitialCommand,
208209
workingDirectory: null,
209210
configurationName: null);
@@ -213,15 +214,15 @@ internal static int Start(string bannerText, string helpText)
213214
{
214215
ApplicationInsightsTelemetry.SendPSCoreStartupTelemetry("NamedPipe");
215216
ProfileOptimization.StartProfile("StartupProfileData-NamedPipeServerMode");
216-
System.Management.Automation.Remoting.RemoteSessionNamedPipeServer.RunServerMode(
217+
RemoteSessionNamedPipeServer.RunServerMode(
217218
configurationName: s_cpp.ConfigurationName);
218219
exitCode = 0;
219220
}
220221
else if (s_cpp.SocketServerMode)
221222
{
222223
ApplicationInsightsTelemetry.SendPSCoreStartupTelemetry("SocketServerMode");
223224
ProfileOptimization.StartProfile("StartupProfileData-SocketServerMode");
224-
System.Management.Automation.Remoting.Server.HyperVSocketMediator.Run(
225+
HyperVSocketMediator.Run(
225226
initialCommand: s_cpp.InitialCommand,
226227
configurationName: s_cpp.ConfigurationName);
227228
exitCode = 0;

0 commit comments

Comments
 (0)