Working with XML and COM

We explored the basics of WMI and CIM; and yes, that was just the basics. After completing the XML topic, we will discuss cmdlet definition XML (CDXML), which is used to map the PowerShell cmdlets, and the CIM class operations or methods.

I have seen most developers create XML files using Visual Studio and use some tools to compare XML. It's not a wrong method, but we have a much more convenient way to play with XML using PowerShell.

XML is the type accelerator for System.Xml.Document.

Note

To explore all the type accelerators in Windows PowerShell, use the following code:

[psobject].Assembly.GetType("System.Management.Automation.TypeAccelerators")::get

Let's take a look at the basic structure of an XML document:

<?xml version="1.0" ...

Get PowerShell: Automating Administrative Tasks now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.