PowerShell Command History

I use Bash and PowerShell interchangeably and find it rather annoying when I cannot do Ctrl + R in my PowerShell console.

Is there a plugin / alternative command that can help me easily switch between Bash and PowerShell?

Update (2018)

PowerShell now supports Ctrl + R. Please see this answer .

+10
source share
3 answers

An alternative command is, for example, to type, for example, #ls and press Tab while holding down the Tab key to view the entire history of commands that starts with ls .

In previous versions, you could type ls , then F8 to match the story. Keep pressing F8 to switch between multiple matches.

Note: in this case ls is just a placeholder. Replace it with whatever command you want.

+15
source

Take a look at PSReadline: https://github.com/lzybkr/PSReadLine

This module supports interactive history search in emacs mode, and you can associate Ctrl + R with ReverseHistorySearch in Windows mode if you want.

The long-term goal of PSReadline is to greatly facilitate the transition from bash to PowerShell wrt command-line editing while providing PowerShell experience, for example. tab.

+5
source

PowerShell currently supports the shortcut Ctrl + R.

Just hit Ctrl + R in the PowerShell console and start typing in any part of the command that you ran earlier.


As an alternative:

Start typing the part of the command that you ran earlier and press or press F8 .

Keep pressing F8 to switch between similar commands.

+5
source

Source: https://habr.com/ru/post/951775/


All Articles