PowerShell ISE add-on to manage WMI permanent event filters, consumers, and bindings

When I am working with Windows PowerShell, PowerShell ISE is my second home. I prefer to do everything within PowerShell ISE and not move away from it to other tools. If you have followed my recent posts, I’ve released a custom DSC module for managing WMI permanent event filters, consumers, and bindings. While experimenting with this module, I had created multiple instances of these WMI objects. There were different ways to delete these objects. Trevor had created a WMIEventHelper utility and Boe converted that it into a WPF UI. I could, of course, delete these objects using PowerShell itself. However, none of this was really integrated into the PowerShell ISE UI.

This is what today’s post is about. I’ve created an PowerShell ISE add-on for deleting the filters, consumers, and bindings I’d created using my DSC resource module.

events

The source code for this PowerShell ISE add-on is available on Github and you can compile it using Visual Studio (Community Edition?) 🙂

Once you compile the DLL, you can load it using the Add-Type cmdlet and then add it to the vertical add-ons in ISE.

Add-Type -Path 'C:\Script\PSMag.dll'
$psISE.CurrentPowerShellTab.VerticalAddOnTools.Add('Events',[PSMag.WMIEventsAddon],$true)

I have only included the delete functionality in this initial release. While it is not tough to provide create functionality, it is low on my priority list at this moment. Since I will be using only the DSC resource module to create these WMI objects, I am exploring the ability to generate a DSC configuration script for each of the instances instead of using WMI directly.

The next update will have exploring instance details by double-clicking any of the instances. Stay tuned.

About the author: Ravikanth C

Ravikanth is the founder and editor of the PowerShell Magazine. He is also a PowerShell MVP who works at Dell Inc. He blogs at http://www.ravichaganti.com/blog and you can follow him on Twitter @ravikanth.

Related Posts

%d bloggers like this: