PSDiagramGenerator is a diagram generator for PowerShell scripts. The available feature is to generate UML class diagrams for mermaid
and PlantUML
.
New-MermaidClassDiagram [-Path]
New-PlantUMLClassDiagram [-Path]
This module has a dependency on PSClassUtils powershell module. The module is installed automatically.
Install-Module -Name PSDiagramGenerator
Generate a class diagram for mermaid from PowerShell class syntax. Source code of the class diagram is copied to the clipboard.
The markdown code is copied to the clipboard by following function.
New-MermaidClassDiagram -Path ./example/Animal.psm1
```mermaid
classDiagram
Animal o-- Name
Animal <|-- Dog
Dog o-- Name
Animal <|-- Fish
Fish o-- Name
class Animal {
+Name name
+Animal(Name name) Animal
+move() Void
}
class Name {
+String value
+Name(String name) Name
}
class Dog {
+Dog(Name name) Dog
+move() Void
}
class Fish {
+Fish(Name name) Fish
+move() Void
}
```
classDiagram
Animal o-- Name
Animal <|-- Dog
Dog o-- Name
Animal <|-- Fish
Fish o-- Name
class Animal {
+Name name
+Animal(Name name) Animal
+move() Void
}
class Name {
+String value
+Name(String name) Name
}
class Dog {
+Dog(Name name) Dog
+move() Void
}
class Fish {
+Fish(Name name) Fish
+move() Void
}
If the classes exist in multiple files, use the cmdlet like following.
New-MermaidClassDiagram -Path (Get-Item -Path ./*.psm1)
Generate a class diagram for PlantUML from PowerShell class syntax. Source code of the class diagram is copied to clipboard.
The plantuml code is copied to the clipboard by following function.
New-PlantUMLClassDiagram -Path ./example/Animal.psm1
@startuml
Animal o-- Name
Animal <|-- Dog
Dog o-- Name
Animal <|-- Fish
Fish o-- Name
class Animal {
+Name name
+Animal(Name name) Animal
+move() Void
}
class Name {
+String value
+Name(String name) Name
}
class Dog {
+Dog(Name name) Dog
+move() Void
}
class Fish {
+Fish(Name name) Fish
+move() Void
}
@enduml
If the classes exist in multiple files, use the cmdlet like following.
New-PlantUMLClassDiagram -Path (Get-Item -Path ./*.psm1)
Generate other diagrams.