PowerShell select-xml xpath doesn't seem to work PowerShell select-xml xpath doesn't seem to work powershell powershell

PowerShell select-xml xpath doesn't seem to work


Maybe the issue is with the xml namespace. Try using the -namespace to get the correct xpath query.

Test this by removing the xmlns from a feature.xml file and running your command.


Even a "default" namespace has to be specified to Select-Xml e.g.:

$ns = @{dns = 'http://schemas.microsoft.com/sharepoint/'}ls . -r feature.xml | Select-Xml '//dns:Feature' -Namespace $ns