I'm confused about how PSReadLine history works across sessions in Powershell. I can see in PS version 5.1 my previous command history is automatically stored in
%userprofile%\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadline\
However, if I run get-history I only see my current session command history. I thought hooks to save command history across sessions was no longer needed in later versions of Powershell. What am I missing?
The file
%userprofile%\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadline\ConsoleHost_history.txt
containing only the entered commands (here ATM 22k lines),
and the current sessions history
Get-History | Format-List -Property *
Id : 88
CommandLine : get-help Get-History -online
ExecutionStatus : Completed
StartExecutionTime : 2018-12-14 16:16:49
EndExecutionTime : 2018-12-14 16:16:49
are quite different things.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With