WMI

Personally I always find Windows Management Instrumentation (WMI) ugly, it never seems to look nice and I believe good code should look good. However WMI does open up a lot of possibilities when using PowerShell, so it is hard to ignore. One interesting article to start off with is Use PowerShell and WMI to calculate server uptime.

I simple example is using WMI to get Windows Service information, as follows:

Get-WmiObject Win32_Service | Format-Table Name, DisplayName, State, StartMode, StartName
This will return a table containing all the Windows Services, what they are called, their current state and start mode, quite handy really.