PowerShellのConsoleHost_history.txtについて

Windows 10のPowerShell version 5.0では、PowerShellの入力履歴はデフォルトで以下のファイルに保存される:

C:\Users\[username]\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadLine\ConsoleHost_history.txt

ConsoleHost_history.txtにはユーザーがPowerShellターミナルを起動して対話モードで入力したコマンドの履歴が保存される。PowerShellターミナルを介さずに実行されたコマンドは記録されない。

元々はPSReadLineというモジュールの機能の一部だった。

参考
https://github.com/PowerShell/PSReadLine
https://docs.microsoft.com/en-us/powershell/module/psreadline/get-psreadlineoption?view=powershell-7

Leave a Reply

Your email address will not be published. Required fields are marked *