From the course: PowerShell: Functions for Advanced Automation

Unlock the full course today

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

Read data from XML files

Read data from XML files

From the course: PowerShell: Functions for Advanced Automation

Start my 1-month free trial

Read data from XML files

- [Instructor] There are a few different format output options when it comes to capturing PowerShell content in a file. All of these files are clear text and can be opened with Notepad, and each one has its own formatting to help sort out the information. Text files, for example, use the same white space that displays on the screen in the shell. CSV files, by contrast, use basic punctuation to create tables of information. XML files will take things to the next level. XML is the markup language that creates tables of data using the same concept as another markup language that most people are familiar with, HTML. In HTML, you create a table by saying that you want a table, and then you define rows within that table, and finally, you define cells within those rows. XML formatted files have some very similar looking characteristics. XML formatted variables have a few methods that you can us in PowerShell to pull specific types of data out of that table. Let's take a look at this XML…

Contents