Search through previous powershell commands with grep
It can be really difficult trying to remember that command you used a few weeks ago in Powershell. Here’s an easy way to search through your previous commands to find the right one and jog your memory. First, run
1 2 |
[cc lang="powershell"](Get-PSReadlineOption).HistorySavePath C:\Users\username\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadline\ConsoleHost_history.txt[/cc] |
Then you can cat the output to look for the command
1 |
[cc lang="powershell"]cat C:\Users\username\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadline\ConsoleHost_history.txt[/cc] |
Or just open…