Chapter 14. Using Windows Management Instrumentation and CIM
We’ve been looking forward to writing this chapter, and dreading it at the same time. Windows Management Instrumentation (WMI) is probably one of the best things Microsoft has ever offered to administrators. It’s also one of the worst things the company has ever inflicted on us. WMI offers a way to gather an amazing amount of system information from a computer. But it can sometimes feel arcane, and the documentation is far from user friendly. In this chapter, we introduce you to WMI the PowerShell way, showing you how it works and explaining some of its less beautiful aspects, to provide you with full disclosure on what you’re up against.
We want to emphasize that WMI is an external technology; PowerShell merely interfaces with it. The focus in this chapter is on how PowerShell does that, and not on the underlying guts of WMI itself. If you’d like to explore WMI further, we offer some suggestions at the end of this chapter. Keep in mind that PowerShell v3 has made some amazing strides in minimizing how much you have to touch WMI yourself, which greatly improves the situation.