Answer the question
In order to leave comments, you need to log in
Why doesn't powershell save command history?
I welcome everyone! Please tell me, there is a computer without the Internet with Windows 8.1, I really wanted to have the same convenient opportunity in PS that Win10 already has out of the box in Win10 - namely, saving the history of entered commands, downloaded the PSReadline module for this, manually copied it into the folder with powershell modules, imported the module using import-module psreadline, when viewing the current options using Get-PSReadlineOption, the module shows that saving is enabled and working:
HistorySaveStyle : SaveIncrementally
History is saved in:
HistorySavePath : C:\Users\Username\AppData\ Roaming\Microsoft\Windows\PowerShell\PSReadline\ConsoleHost_history.txt
However, when the powershell is restarted, it is not possible to return the previous commands using the cursor arrows as in Win10 - i.e. the history is empty, but the path
C:\Users\Username\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadline\ConsoleHost_history.txt is empty - there is neither the ConsoleHost_history.txt file nor even the \PowerShell\PSReadline\ folder
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question