From the course: PowerShell for SQL Server Administration

Unlock the full course today

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

Exporting XML data

Exporting XML data - PowerShell Tutorial

From the course: PowerShell for SQL Server Administration

Start my 1-month free trial

Exporting XML data

Let's go ahead and talk about exporting data to XML files. So there's some systems out there that are going to require that you send them a CSV file if you need to send data over to a third party app or third party service. There are some that are going to want some sort of XML file for the interchange. So you can do that very easily through PowerShell. So you can hand those XML files off fairly easily once you export them. There's a set of cmdlets called Export.Clixml that will let you create XML files based on the data that you're passing in. So this is a fairly easy process to do. You can do a lot like what you're doing with a CSV file for that data export. You can do a lot of manipulation ahead of time, get the data exactly as you want it inside a variable, and then once you're done, simply pass that data from a variable to export CLI and that will then store that as an XML file on the hard drive, which you can then pass that file off to a third party. So you're going to FTP it…

Contents