ISE Addons, PowerShell, Scripting
comments 2

PowerShell ISE Addon: Search all open script files

If you have used PowerShell ISE, you might have already noticed that you cannot search across all open script files and across open tabs. This becomes important when you are working with multiple files at the same time. So, this made me write a simple addon using WinForms. Now, before you think that you can do the same in very few lines of WPF — yes, I understand that but I am not yet comfortable with WPF in PowerShell. WinForms is always a winner when it comes to writing simple addons and it is probably the fastest way!

Now, let us look at the code:

Yes, the only side-effect of using WinForms — actually PrimalForms Community Edition — is the amount of code it generates. The actual logic for searching across and moving to desired location in ISE is just 10+ lines of code.

Anyway, all you have to do is, copy / paste the above code snippet in your ISE profile.

When you select Add-Ons -> Search All Files, you will see a dialog box similar to the one below:

ISE-Search Addon

ISE-Search Addon

Once you search for a keyword, you can double click the desired row to change the focus to the search result in the editor. This search supports RegEx as well.

If you want to see this in action, just watch the below video:

Filed under: ISE Addons, PowerShell, Scripting


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.