Stephanevg / PSClassUtils

A set of utilities to work with Powershell Classes
http://powershelldistrict.com/how-to-generate-a-uml-diagram-using-powershell/
90 stars 22 forks source link

Write-CUClassDiagram error if multiple constructor #110

Open LaurentLienhard opened 5 years ago

LaurentLienhard commented 5 years ago

When you generate a diagram for the simple class with 2 constructors

class ClassName {
    [System.String]$Param1
    [System.String]$Param2
    [System.String]$Param3

    ClassName ([System.String]$Param1,[System.String]$Param2) {
        Write-Verbose "Param 1 = $($Param1)"
        Write-Verbose "Param 2 = $($Param2)"
    }

    ClassName ([System.String]$Param3) {
        Write-Verbose "Param 3 = $($Param3)"
    }
}

There's an error on the diagram

image

LaurentLienhard commented 5 years ago

In the Out-CUPSGraph function the parameter $InputObject seems good The function find 2 constructors and the second does have only one parameter image

it seems that it is after this scriptblock that the problem appears $Graph = Graph -ScriptBlock line 631

I hope it helps you a little