I'm wondering if there's a bug in PowerShell 7.6.0 on Windows 11 that's causing it to stop saving the PSReadLine command history. Since I updated from version 7.5.5 to 7.6.0, I've noticed that my recent commands aren't showing up in the history, and the history file located at `C:UsersUserNameAppDataRoamingMicrosoftWindowsPowerShellPSReadLineConsoleHost_history.txt` hasn't been updated for the last six days. I use the default PSReadLineOptions, except for a couple of tweaks: BellStyle is set to 'Visual', HistorySaveStyle is 'SaveAtExit', and MaximumHistoryCount is 768. I even tried clearing older entries in the history file since it seemed full, but still no luck with saving the history after the update.
3 Answers
I’m not sure about the issue, but I lost all my history after installing version 7.6.0. It's really frustrating!
I haven't explicitly configured my history, and it still works as expected. Just a heads up, the path you mentioned is typically for version 5. Isn't PowerShell 7 supposed to store its logs elsewhere?
Yep, that's correct! The common path for both versions is `$Env:APPDATAMicrosoftWindowsPowerShellPSReadLine$($Host.Name)_history.txt`. You can find more info in the documentation.
Have you tried switching the history save style to 'SaveIncrementally'? It sounds like there might be a bug related to 'SaveAtExit'.
Yeah, I switched to 'SaveIncrementally', and it seems to work fine now. I probably need to edit the title of my post but can't figure out how.

Actually, both PowerShell 5 and 7 save their history in the same location: `C:UsersUsernameAppDataRoamingMicrosoftWindowsPowerShellPSReadLineConsoleHost_history.txt`. It's set up that way by default.