Up-arrow history matching in powershell 7

Viewed 180

I'd like to get history matching in powershell 7 like: when I type npm and up arrow key, it would show my last command started with the keyword npm (Ex: npm run build).

I was able to achieve this in powershell 5 here. But this is not working in 7. When I run the discussed command:

Set-PSReadlineKeyHandler -Key UpArrow -Function HistorySearchBackward

I'm getting an error like:

Update-Module: A parameter cannot be found that matches parameter name 'Key'.
0 Answers
Related