XPath and Powershell - Default namespace XPath and Powershell - Default namespace powershell powershell

XPath and Powershell - Default namespace


I can't be 100% sure without looking at the actual XML document (or representative sample of it). Anyway, it is often due to lack of namespace prefix usage in the xpath.

Note that in the case of default namespace, not only the element where default namespace declared, but also all of it's descendants are considered in the same namespace*. I'd suggest to try the following xpath :

/ns:Project/ns:ItemGroup/ns:Reference

*: except of explicit prefix usage in the descendant element, or other default namespace declared in descendant level (in a more local scope).