Get your command history from Powershell

Hits: 978

 

Powershell Command History

I need to remember my Powershell history and to search it. I am used to Linux / Unix where I just do history | grep <part of my command> and I get what I want.  That is as long as I had used exit when I completed the session so that it writes the history file.

PowerShell saves the last 4096 commands that are stored in a  text file located in the profile of each user %userprofile%\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadline\ConsoleHost_history.txt.