PowerShell Deep Dive Treasure

Without a doubt the PowerShell Deep Dive conference was one of the best meetings I’ve ever attended and I wanted to share one tidbit I came away with that I find immensely useful and never knew. During one of Bruce Payette’s talks he tossed out, practically as an aside, a reference to searching command line history with the # character. What!!???

I never heard of this and it is very slick. From the command prompt (either the console or ISE) enter the # character followed by whatever part of a previous command you remember. It does not have to be the start of the command, it can be any part of it. Then press TAB. PowerShell will search your history buffer and return the first match. If there are multiple matches you can keep pressing TAB to cycle through them. Awesome! The beauty for me is that it just brings the command back to the prompt so you can edit it.

Thank you Bruce!

3 thoughts on “PowerShell Deep Dive Treasure

  1. Nice tip!

    But to be honest i have been doing this in tcsh on UNIX via ESC-P for about 15 years 🙂


  2. Pingback: PowerShell Deep Dive Treasure - The Lonely Administrator - Powershell.com – Powershell Scripts, Tips and Resources

Comments are closed.