ISE Addons, PowerShell, Scripting
comment 1

PowerShell ISE Addon: Get-History GUI

Ok, that is a weird blog post title. I could not think of a better one for this post. Anyway, coming to the subject and as I mentioned earlier, I have several PowerShell ISE addons that I use on a regular basis. I kept writing them whenever I found the need. I have been polishing these addons for sharing here. So, here is another one in the ISE addons series.

If you have used PowerShell console or even traditional console (cmd.exe), you might have used the F7 functionality of the console host. This, when used, displays a nice little pop-up menu with the command history. You can just scroll through the list and select an item to execute it again at the console. This will be very useful when you have very long command history and using arrows keys won’t really help. This is how that popup looks:

PowerShell console - F7

PowerShell console - F7

However, this functionality is not available in PowerShell ISE. So, here is a simple addon that shows command history in a WinForms data grid and you can double click on the desired item to copy the CommandLine text to PowerShell ISE command pane.

Now, I just used my ISE Addon menu generator to add this scriptblock to ISE as an addon.

New Menu Item

New Menu Item

This is it. Now, I can press F7 in PowerShell ISE and get a list of all commands in the command history.

PowerShell ISE - F7

PowerShell ISE - F7

Now, I can just select an item in that list and double-click. It will appear at the PowerShell ISE command pane. I just need to press enter. 🙂

ISE CommandPane

ISE CommandPane

Filed under: ISE Addons, PowerShell, Scripting

by

Ravikanth is a principal engineer and the lead architect for Microsoft and VMware virtualized and hybrid cloud solutions within the Infrastructure Solutions Group at Dell EMC. He is a multi-year recipient of Microsoft Most Valuable Professional (MVP) award in Windows PowerShell (CDM) and Microsoft Azure. Ravikanth is the author of Windows PowerShell Desired State Configuration Revealed (Apress) and leads Bangalore PowerShell and Bangalore IT Pro user groups. He can be seen speaking regularly at local user group events and conferences in India and abroad.