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!!???
ManageEngine ADManager Plus - Download Free Trial
Exclusive offer on ADManager Plus for US and UK regions. Claim now!
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!
Awesome tip! Thanks for sharing Jeff
Nice tip!
But to be honest i have been doing this in tcsh on UNIX via ESC-P for about 15 years 🙂
-Alex