1
尽管我在线看到过这些示例,但似乎无法对PowerShell中的属性值执行XPath搜索。对PowerShell中属性值的XPath搜索
[xml]$xml = '<a><b><c foo="bar"></c></b></a>'
$xml | select-xml -xpath //c[@foo] # This returns a node
$xml | select-xml -xpath //c[@foo='bar'] # This does not
我从来没有被如此简单的东西难住。 :-)我怎样才能使这个工作?