$HistoryFilePath = Join-Path ([Environment]::GetFolderPath('UserProfile')) .ps_history Register-EngineEvent PowerShell.Exiting -Action { Get-History | Export-Clixml $HistoryFilePath } | out-null if (Test-path $HistoryFilePath) { Import-Clixml $HistoryFilePath | Add-History } # if you don't already have this configured... Set-PSReadlineKeyHandler -Key UpArrow -Function HistorySearchBackward Set-PSReadlineKeyHandler -Key DownArrow -Function HistorySearchForward