Skip to content

Instantly share code, notes, and snippets.

@ducas
Created May 12, 2015 05:04
Show Gist options
  • Save ducas/f6ce4c59292c5db73eeb to your computer and use it in GitHub Desktop.
Save ducas/f6ce4c59292c5db73eeb to your computer and use it in GitHub Desktop.
Find project references and determine whether they're local or GAC
ls -Recurse -Filter *.csproj | %{
$filename = $_.FullName
$ns = @{ msbuild = "http://schemas.microsoft.com/developer/msbuild/2003" }
#[xml]$proj = Get-Content $filename
$proj = Get-Content $filename | Out-String
Select-Xml -Xml $proj -XPath "//msbuild:Reference" -Namespace $ns | %{
$item = $_.Node.Include
$hintPath = $_.Node.HintPath
$isGac = $hintPath -eq $null
new-object PSObject -Property @{ Item = $item; IsGac = $isGac }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment