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.