管理 PowerShell 的命令历史

Posted by Yun on Wed, May 10, 2023

介绍

PowerShell 的命令历史记录可以用来做很多事情,例如提供给 PSReadLine 来完成命令预测和历史搜索。

若想要管理这些本地的历史记录,只需要运行:

1(Get-PSReadlineOption).HistorySavePath

此时命令行打印的路径即为历史命令的记录文件,使用文本编辑器对其进行编辑即可。

参考链接

PowerShell: Clear History of Previous Commands


版权声明:本文遵循 CC BY-SA 4.0 版权协议,转载请附上原文出处链接和本声明。

Copyright statement: This article follows the CC BY-SA 4.0 copyright agreement. For reprinting, please attach the original source link and this statement.