Created
July 10, 2017 07:49
-
-
Save vpetruchok/0f8834c562547c19113a3d9f8b6bc882 to your computer and use it in GitHub Desktop.
PowerShell Repl History
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# from https://superuser.com/questions/880213/automatically-export-history-at-end-of-powershell-session | |
$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 } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment