mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Fix PSReadLine history path on Windows
Bug introduced in initial port of PSReadLine. `Path.Combine` sees the initial backslash as an absolute path, thus discarding `AppData`.
This commit is contained in:
@@ -172,8 +172,8 @@ namespace Microsoft.PowerShell
|
||||
#if CORECLR
|
||||
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) // MS Windows
|
||||
{
|
||||
HistorySavePath = System.IO.Path.Combine(Environment.ExpandEnvironmentVariables("%AppData%"),
|
||||
@"\Microsoft\Windows\PowerShell\PSReadline\",
|
||||
HistorySavePath = System.IO.Path.Combine(Environment.GetEnvironmentVariable("APPDATA"),
|
||||
@"Microsoft\Windows\PowerShell\PSReadline\",
|
||||
hostName + "_history.txt");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user