December 21st, 2015

PowerTip: Eliminate Duplicates in PowerShell History

Doctor Scripto
Scripter

Summary: Use an option in the PSReadLine module to control Windows PowerShell 5.0 history duplication.

Hey, Scripting Guy! Question How can I make sure that there are no duplicates in my history?

Hey, Scripting Guy! Answer In Windows PowerShell 5.0 with the PSReadLineModule loaded, use the Set-PSReadLineOption 
           cmdlet as follows:

Set-PSReadLineOption –HistoryNoDuplicates:$True

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.