From the course: Complete Guide to PowerShell 7
Unlock this course with a free trial
Join today to access over 24,400 courses taught by industry experts.
Parsing XML data - PowerShell Tutorial
From the course: Complete Guide to PowerShell 7
Parsing XML data
- [Instructor] Now there are times where you may not want to work with JSON and you may want to use XML because that's the integration that you are using, or the web service may just return XML. Now to do that, we're going to use the same mechanism here, but this time we're adding a different header to anonymous kind of endpoint here, where we're going to specify that it's application XML. So I'm going to select this object here, right click and run selection. So I get a response, and then I'm going to say response run selection. And of course it didn't come back with my dollar sign. So there we go, I've got one now. And it comes back as security events, which means I should be able to type security events and then get an event that comes back like so. And sure enough, there's all my list. Now, depending on the web service, it may just come back in that format. Otherwise you may need to run that and say convert that to an XML document, so strongly type it and then you're able to…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
-
-
-
-
-
-
(Locked)
Working with APIs and web services11m 36s
-
(Locked)
Making HTTP requests with Invoke-RestMethod8m 33s
-
(Locked)
Making HTTP requests with Invoke-WebRequest1m 59s
-
(Locked)
Parsing JSON data2m 27s
-
(Locked)
Parsing XML data3m 23s
-
(Locked)
Creating custom API integrations9m 4s
-
(Locked)
Automating web operations5m 47s
-
(Locked)
Handling other data formats4m 34s
-
(Locked)
-
-
-