N
N
Nordman992020-03-02 10:15:45
PowerShell
Nordman99, 2020-03-02 10:15:45

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

1 answer(s)
A
azarij, 2020-03-02
@Nordman99

what does $psversiontable say?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question