PowerShell module to draw a graph of c# projects dependencies. It can also spot some kind of issues with libraries and nuget packages references (for example: multiple version of the same library\package).
##How to load module You have to import ProjectGraphs module into Package Manager Console in Visual Studio. To do that use command
PM> Import-Module path/ProjectGraphs.psm1where path is the location of ProjectGraphs.psm1 file. You can also import ProjectGraphs module in your profile file (after that ProjectGraphs module will be loaded during every startup of Visual Studio). To do that you have to first find out the path to your profile file path.
PM> $profile
C:\Users\XXX\Documents\WindowsPowerShell\NuGet_profile.ps1Copy ProjectGraphs.psm1 file into location returened by $profile and add the following code into profile file (If the file doesn't exist you have to create him)
function Import-LocalModule($module)
{
$profilePath = $profile | Split-Path -Parent
$modulePath = Join-Path -Path $profilePath -ChildPath $module
Import-Module $modulePath -DisableNameChecking -Force
}
Import-LocalModule ProjectGraphs.psm1##How to draw a project graph To draw a graph of current project dependencies (between projects)
Generate-ProjectGraphTo show dependencies between all projects in solution
Generate-ProjectGraph -AllProjectsTo show the dependecies to dll libraries
Generate-ProjectGraph -IncludeReferencesTo show the dependecies to nuget packages
Generate-ProjectGraph -IncludeNugetPackagesTo exclude given projects from graph (for example Tests)
Generate-ProjectGraph -Exclude "*Tests"You can combine the above paramaters together. For example to display solution full graph without Test projests
Generate-ProjectGraph -AllProjects -IncludeReferences -Exclude "*Tests"