Chapter 16. Working with providers, files, and CIM
This chapter covers
- PowerShell providers
- Files, text, and XML
- Accessing COM objects
- Using CIM
Outside of a dog, a book is man’s best friend. Inside of a dog, it’s too dark to read.
Groucho Marx
No matter how hard you try to avoid it, you’ll have to work with data at some time while using PowerShell. The great news is that PowerShell can work with data in about any format you care to name. The not-so-good news is that you’ll have to learn a bunch of new techniques to work with that data.
In this chapter, we’re going to concentrate on using PowerShell to
- Work with flat files, including XML
- Access COM objects
- Use the Common Information Model (CIM) classes to perform administration tasks
In addition, PowerShell can expose data stores, such as the registry, SQL Server, or Active Directory, in the same way as it exposes the file system through PowerShell providers. This means that once you’ve learned how to work with one provider you have a minimal learning curve to work with the others. This is huge boost to your productivity and makes you immediately effective with new technologies.
We’ll start by looking at the providers built in to PowerShell before moving on to the other types of data.