From the course: PowerShell 5 Essential Training

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Working with XML

Working with XML - PowerShell Tutorial

From the course: PowerShell 5 Essential Training

Start my 1-month free trial

Working with XML

- Another common file type that I like to work a lot with in Powershell, helps me work with databases, it's XML. XML is a great format to be able to send data to, and Powershell has some Cmdlets that can help us with that. Now you're gonna notice in Export it says Clixml. That stands for command line interface XML. There's also an Import. You'll see there's a ConvertTo. If you watch the one on CSVs, this does the same thing. Convert to XML, leaves the information in the pipeline in case you want to manipulate it further down the pipeline. Export immediately puts it to a file. Import will bring it back into the system. Let's take a look here. I'm gonna do get-process. This will get me a list of processes in Windows that are currently running. You can see from the column headers, I've got Handles and the physical memory, and the virtual memory, and CPU, and Id, and the ProcessName. Let's go ahead and put this into an XML file. So I'm gonna pipe it to Export-clixml. Has a mandatory…

Contents