diff --git a/src/Microsoft.PowerShell.PSReadLine/Cmdlets.cs b/src/Microsoft.PowerShell.PSReadLine/Cmdlets.cs index 7a72cee73..ffb40e744 100644 --- a/src/Microsoft.PowerShell.PSReadLine/Cmdlets.cs +++ b/src/Microsoft.PowerShell.PSReadLine/Cmdlets.cs @@ -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"); }