Skip to content

Instantly share code, notes, and snippets.

@aaronpowell
Created April 30, 2014 05:13
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save aaronpowell/d798507cbca08d86b41a to your computer and use it in GitHub Desktop.
Save aaronpowell/d798507cbca08d86b41a to your computer and use it in GitHub Desktop.
Find csproj files referencing an assembly
Get-ChildItem -Filter *.csproj -Recurse |
Select-Object -Property FullName,@{N="Xml"; E = {
Select-Xml -Path $_.FullName -XPath //b:Reference -Namespace @{b='http://schemas.microsoft.com/developer/msbuild/2003'} |
Select-Object -ExpandProperty Node |
Select-Object -Property Include, HintPath |
Where-Object { $_.HintPath -ne $null } |
Where-Object { $_.Include -eq "My.Assembly.Name" }
} } |
Where-Object { $_.Xml -ne $null } |
Out-GridView
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment