# XML ChildNode retrieve value

**URL:** <https://forums.powershell.org/t/xml-childnode-retrieve-value/14399>\
**Category:** PowerShell Help\
**Created:** [May 20, 2020, 9:56am UTC](https://forums.powershell.org/t/xml-childnode-retrieve-value/14399 "2020-05-20T09:56:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![imahnobody](https://avatars.discourse-cdn.com/v4/letter/i/a5b964/32.png) [@imahnobody](https://forums.powershell.org/u/imahnobody)\
**Post date:** [May 20, 2020, 9:56am UTC](https://forums.powershell.org/t/xml-childnode-retrieve-value/14399/1 "2020-05-20T09:56:58Z")

</div>

I’m looking through some GPO settings using Get-GPOReport with the ReportType of Xml. The setting I’m looking at is on the Computer Configuration \> Preferences \> Windows Settings \> Files.

```
$ReferenceGPOId="69564100-428E-4272-B12A-886986E68F92"
[xml]$ReferenceGPOReport=Get-GPOReport -Guid $ReferenceGPOId -ReportType Xml
$ReferenceGPO=$ReferenceGPOReport.GPO.Computer.ExtensionData.Extension

$q1=$ReferenceGPO | Where-Object {$_.q1}
$q1.ChildNodes.ChildNodes | Select-Object -Property *
```

When I see the ChildNodes property, I see these values:

```
ChildNodes : {q1:GPOSettingOrder, q1:Properties, q1:Filters}
```

But when I try to access the values, I only get :

```
#text
-----
1
```

I tried to look at the members and going through the properties to see if I could retrieve the information, but I couldn’t. I might be able to do it in a string, but I’m sure there’s another way to get that information. Any body know how?

---

<div class="post-metadata">

**Author:** ![rob-simmers](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/rob-simmers/32/1010_2.png) [@rob-simmers](https://forums.powershell.org/u/rob-simmers)\
**Post date:** [May 20, 2020, 10:14am UTC](https://forums.powershell.org/t/xml-childnode-retrieve-value/14399/2 "2020-05-20T10:14:10Z")

</div>

It’s difficult to assist without seeing the actual schema of the XML and what exactly you are attempting to get, but if you are selecting a node q1, why not just continue with dot notation.

```
$ReferenceGPO=$ReferenceGPOReport.GPO.Computer.ExtensionData.Extension.q1
```

Normally, you can just keep using intellisense to continue to get to the node you want to see. If you do want to post XML, you may need to do [https://gist.github.com/](https://gist.github.com/)

---

<div class="post-metadata">

**Author:** ![imahnobody](https://avatars.discourse-cdn.com/v4/letter/i/a5b964/32.png) [@imahnobody](https://forums.powershell.org/u/imahnobody)\
**Post date:** [May 20, 2020, 10:36am UTC](https://forums.powershell.org/t/xml-childnode-retrieve-value/14399/3 "2020-05-20T10:36:48Z")

</div>

Surprising I actually found the answer.

```
$q1.ChildNodes.ChildNodes.ChildNodes.LocalName
```

I actually found the answer by doing this:

```
$q1.ChildNodes.ChildNOdes.ChildNodes | Select-Object -Property *
```

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:29pm UTC](https://forums.powershell.org/t/xml-childnode-retrieve-value/14399/4 "2024-05-16T20:29:37Z")

</div>


