Skip to content

Instantly share code, notes, and snippets.

@elacy
Created January 31, 2017 00:03
Show Gist options
  • Save elacy/e5c44796d01b621442898bc2a2fafd48 to your computer and use it in GitHub Desktop.
Save elacy/e5c44796d01b621442898bc2a2fafd48 to your computer and use it in GitHub Desktop.
$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
# Load posh-git example profile
. 'C:\code\posh-git\profile.example.ps1'
cd c:\code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment