【发布时间】:2009-09-17 13:07:06
【问题描述】:
背景:
PowerShell 历史记录对我来说非常有用,因为我可以跨会话保存历史记录。
# Run this every time right before you exit PowerShell
get-history -Count $MaximumHistoryCount | export-clixml $IniFileCmdHistory;
现在,我正试图阻止 PowerShell 将重复的命令保存到我的历史记录中。
我尝试使用Get-Unique,但这不起作用,因为历史记录中的每个命令都是“唯一的”,因为每个命令都有不同的 ID 号。
【问题讨论】:
-
有
Set-PSReadlineOption -HistoryNoDuplicates,但它似乎对我不起作用。
标签: command-line powershell history