Skip to content

cezarypiatek/ProjectGraphs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ProjectGraphs

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).

Sample screenshot

##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.psm1

where 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.ps1

Copy 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-ProjectGraph

To show dependencies between all projects in solution

Generate-ProjectGraph -AllProjects

To show the dependecies to dll libraries

Generate-ProjectGraph -IncludeReferences

To show the dependecies to nuget packages

Generate-ProjectGraph -IncludeNugetPackages

To 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"

About

PowerShell script to draw graph of c# projects dependencies

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors