Skip to content

Instantly share code, notes, and snippets.

@johnmmoss
Created August 4, 2017 10:24
Show Gist options
  • Select an option

  • Save johnmmoss/b348ce02566884f4b5e8527697a26ff2 to your computer and use it in GitHub Desktop.

Select an option

Save johnmmoss/b348ce02566884f4b5e8527697a26ff2 to your computer and use it in GitHub Desktop.
[xml] $axml= Get-Content E:\Code\Library\DataLayer.csproj
$ns = new-object Xml.XmlNamespaceManager $axml.NameTable
$ns.AddNamespace("d", "http://schemas.microsoft.com/developer/msbuild/2003")
$nodes = $axml.SelectNodes( "/d:Project/d:ItemGroup/d:Reference", $ns)
foreach ($node in $nodes) {
$object = New-Object –TypeName PSObject
$object | Add-Member -MemberType NoteProperty –Name File –Value (split-path $path -leaf)
$object | Add-Member –MemberType NoteProperty –Name Name –Value $node.Include
$object | Add-Member –MemberType NoteProperty –Name Path –Value $node.HintPath
$object
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment