Skip to content

Instantly share code, notes, and snippets.

@cgranade
Created July 10, 2018 20:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cgranade/efe206519249479f48b49a9c358a2e7a to your computer and use it in GitHub Desktop.
Save cgranade/efe206519249479f48b49a9c358a2e7a to your computer and use it in GitHub Desktop.
Return a list of NuGet package references for all C# projects in a folder.
Get-ChildItem -Recurse *.csproj -PipelineVariable project `
| Select-Xml -XPath //PackageReference `
| ForEach-Object { [pscustomobject]@{ "Name" = $_.Node.Include; "Version" = $_.Node.Version } } `
| Group-Object { $project} `
| Format-List
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment