mirror of
https://github.com/PowerShell/PowerShell.git
synced 2024-11-23 09:43:57 +08:00
Use temp personal path at Runspace startup when env 'HOME' not defined (#13239)
This commit is contained in:
parent
6ca0024db9
commit
cfb1952fd2
@ -239,6 +239,8 @@ namespace System.Management.Automation
|
||||
DEFAULT
|
||||
}
|
||||
|
||||
private static string s_tempHomeDir = null;
|
||||
|
||||
/// <summary>
|
||||
/// Function for choosing directory location of PowerShell for profile loading.
|
||||
/// </summary>
|
||||
@ -252,7 +254,8 @@ namespace System.Management.Automation
|
||||
string envHome = System.Environment.GetEnvironmentVariable(CommonEnvVariableNames.Home);
|
||||
if (envHome == null)
|
||||
{
|
||||
envHome = GetTemporaryDirectory();
|
||||
s_tempHomeDir ??= GetTemporaryDirectory();
|
||||
envHome = s_tempHomeDir;
|
||||
}
|
||||
|
||||
string xdgConfigHomeDefault = Path.Combine(envHome, ".config", "powershell");
|
||||
|
Loading…
Reference in New Issue
Block a user