J'essaie d'utiliser la commande powershell select-xml pour sélectionner les données d'un fichier xml. Lorsque j'exécute la commande ci-dessous, aucun résultat ou erreur n'est renvoyé. Je m'attends à ce qu'une liste des éditions soit retournée à l'écran. Quel est le problème avec ça?select-xml ne renvoie aucun résultat
PS C:\> select-xml -path "C:\t.xml" -xpath "//edition" | foreach {$_.node.InnerXML}
PS C:\>
Le fichier XML (C: \ t.xml) est:
<?xml version="1.0" encoding="utf-8"?>
<Book>
<projects>
<project name="Book1" date="2009-01-20">
<editions>
<edition language="English">En.Book1.com</edition>
<edition language="German">Ge.Book1.Com</edition>
<edition language="French">Fr.Book1.com</edition>
<edition language="Polish">Pl.Book1.com</edition>
</editions>
</project>
</projects>
</Book>
Je le vois travailler PS H: \ > Select-XML -Path C: \ scripts \ t.xml -XPath "// édition" | % {$ _ Node.InnerXML.} En.Book1.com Ge.Book1.Com Fr.Book1.com Pl.Book1.com PS H: \> – ravikanth