Skip to content

Instantly share code, notes, and snippets.

@jdforsythe
Created March 23, 2016 14:24
Show Gist options
  • Save jdforsythe/e0781c6b270f03f70f3c to your computer and use it in GitHub Desktop.
Save jdforsythe/e0781c6b270f03f70f3c to your computer and use it in GitHub Desktop.
List all VS projects with their NuGet dependencies from a top-level dev folder
#!/bin/bash
DEFAULT_VS_PROJECT_TOP_LEVEL_FOLDER="/e/dev/internal-apps"
# find all nested folders with a packages.config file (where the NuGet package references are stored)
# loop through the results
find ${1:-"${DEFAULT_VS_PROJECT_TOP_LEVEL_FOLDER}"} -name "packages.config" | while read -r filename ; do
echo
echo $(basename "$(dirname "$filename")")
cat "$filename" | grep "<package " | sed -n 's/.*id="\([^"]*\).*version="\([^"]*\).*/\1@\2/p' | sed 's/^/ |-/'
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment