Background:
PowerShell history is a lot more useful to me now that I have a way to save history across sessions.
# Run this every time right before you exit PowerShell
get-history -Count $MaximumHistoryCount | export-clixml $IniFileCmdHistory;
Now, I am trying to prevent PowerShell from saving duplicate commands to my history.
I tried using Get-Unique
, but that doesn't work since every command in the history is "unique", because each one has a different ID number.
Set-PSReadlineOption -HistoryNoDuplicates
, but it doesn't seem to work for me. – Magnus