Skip to content

Instantly share code, notes, and snippets.

@stinos
stinos / Optimize-PSReadlineHistory.ps1
Last active April 24, 2020 08:39 — forked from rkeithhill/Optimize-PSReadlineHistory.ps1
Removes duplicate and optionally short commands from your PSReadline history file
<#
.SYNOPSIS
Optimizes your PSReadline history save file.
.DESCRIPTION
Optimizes your PSReadline history save file by removing duplicate
entries and optionally removing commands that are not longer than
a minimum length
.EXAMPLE
C:\PS> Optimize-PSReadlineHistory
Removes all the duplicate commands.