I need some with help with PowerShell, please. It should be pretty easy:
I have a list of subdirectories, with a xml file in each one. I want to open each xml file and print the value of one node. The node is always the same, as the xml files are actually project files (*.csproj) from Visual Studio.
I already got the list of files: get-item ** \ *.csproj
How do I proceed?
To get the csproj files use
Get-ChildItemThen you can use e.g.
Select-Xmllike this:You have to correct the default namespace. I have no csproj file by hand right now.
(for more info about xml and xpath in PowerShell see http://huddledmasses.org/xpath-and-namespaces-in-powershell/)
The
Select-Objectis needed to expand the actual node property.If you would like to work with xml like with object, you can use this: