I been able in the past to do a similar task but i don't understand why it doesn't work for the this xml. I am using powershell to read iis settings for requestFiltering but when i am searching in the xml the node "fileExtensions" isn't considered a node. here is the xml.
<system.webServer>
<security>
<requestFiltering>
<fileExtensions allowUnlisted="true" applyToWebDAV="true">
<add fileExtension=".config" allowed="true" />
</fileExtensions>
<requestLimits>
<headerLimits>
</headerLimits>
</requestLimits>
<verbs allowUnlisted="true" applyToWebDAV="true">
</verbs>
<hiddenSegments applyToWebDAV="true">
<add segment="web.config" />
</hiddenSegments>
<alwaysAllowedUrls>
</alwaysAllowedUrls>
<alwaysAllowedQueryStrings>
</alwaysAllowedQueryStrings>
<denyUrlSequences>
</denyUrlSequences>
<denyQueryStringSequences>
</denyQueryStringSequences>
<filteringRules>
</filteringRules>
</requestFiltering>
</security>
$val = the above XML:
$xml = [xml]($val)
$node = $xml.SelectSingleNode("//*[local-name() = 'fileExtensions']")
$node is null/ blank. How come?