< Back
Write-CUClassDiagram
Post
NAME Write-CUClassDiagram
SYNOPSIS
This script allows to document automatically existing script(s)/module(s) containing classes by generating the
corresponding UML Diagram.
SYNTAX
Write-CUClassDiagram [-Path] <String> [[-OutPutType] <Object>] [[-OutputFormat] <String>] [[-ExportFolder]
<String>] [-IgnoreCase] [-ShowComposition] [-Show] [-PassThru] [[-Exclude] <String[]>] [<CommonParameters>]
DESCRIPTION
Automatically generate a UML diagram of scripts/Modules that contain powershell classes.
PARAMETERS
-Path <String>
The path that contains the classes that need to be documented.
The path parameter should point to either a .ps1, .psm1 file, or a directory containing either/both of those
file types.
Required? true
Position? 1
Default value
Accept pipeline input? false
Accept wildcard characters? false
-OutPutType <Object>
OutPutType is a Set of 2 variables: Combined, Unique
Combined, all files present in a directory are drawn in the same graph.
Unique, all files present in a directory are drawn in their own graph.
Required? false
Position? 2
Default value Combined
Accept pipeline input? false
Accept wildcard characters? false
-OutputFormat <String>
Using the parameter OutputFormat, it is possible change the default output format (.png) to one of the
following ones:
'jpg', 'png', 'gif', 'imap', 'cmapx', 'jp2', 'json', 'pdf', 'plain', 'dot'
Required? false
Position? 3
Default value png
Accept pipeline input? false
Accept wildcard characters? false
-ExportFolder <String>
This optional parameter, allows to specifiy an alternative export folder. By default, the diagram is created
in the same folder as the source file.
Required? false
Position? 4
Default value
Accept pipeline input? false
Accept wildcard characters? false
-IgnoreCase [<SwitchParameter>]
By default, Class names MUST be case identical to have the Write-CUClassDiagram cmdlet generate the correct
inheritence tree.
When the switch -IgnoreCase is specified, All class names will be converted to 'Titlecase' to force the case,
and ensure the inheritence is correctly drawed in the Class Diagram.
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
-ShowComposition [<SwitchParameter>]
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
-Show [<SwitchParameter>]
Open's the generated diagram immediatly
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
-PassThru [<SwitchParameter>]
When specified, the raw Graph in GraphViz format will be returned back in String format.
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
-Exclude <String[]>
Required? false
Position? 5
Default value
Accept pipeline input? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
OUTPUTS
NOTES
Author: Stephanevg / LxLeChat
www: https://github.com/Stephanevg https://github.com/LxLeChat
Report bugs or ask for feature requests here:
https://github.com/Stephanevg/PsClassUtils
-------------------------- EXAMPLE 1 --------------------------
PS C:\\>#Generate a UML diagram of the classes located in MyClass.Ps1
# The diagram will be automatically created in the same folder as the file that contains the classes (C:\\Classes).
Write-CUClassDiagram.ps1 -File C:\\Classes\\MyClass.ps1
-------------------------- EXAMPLE 2 --------------------------
PS C:\\>#Various output formats are available using the parameter "OutPutFormat"
Write-CUClassDiagram.ps1 -File C:\\Classes\\Logging.psm1 -ExportFolder C:\\admin\\ -OutputFormat gif
Directory: C:\\admin
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 12.06.2018 07:47 58293 Logging.gif
-------------------------- EXAMPLE 3 --------------------------
PS C:\\>Write-CUClassDiagram -Path "C:\\Modules\\PSClassUtils\\Classes\\Private\\" -Show
Will generate a diagram of all the private classes available in the Path specified, and immediatley show the
diagram.
RELATED LINKS
https://github.com/Stephanevg/PsClassUtils
CommonParameters : False
WorkflowCommonParameters : False
details : @{name=Write-CUInterfaceImplementation; noun=; verb=}
Syntax : @{syntaxItem=System.Object[]}
parameters : @{parameter=System.Object[]}
inputTypes : @{inputType=}
returnValues : @{returnValue=}
aliases : None
remarks : None
alertSet :
description :
examples :
Synopsis :
Write-CUInterfaceImplementation [[-Name] <string>] [[-InterfaceType] <type>]
ModuleName : PSClassUtils
nonTerminatingErrors :
xmlns:command : http://schemas.microsoft.com/maml/dev/command/2004/10
xmlns:dev : http://schemas.microsoft.com/maml/dev/2004/10
xmlns:maml : http://schemas.microsoft.com/maml/2004/10
Name : Write-CUInterfaceImplementation
Category : Function
Component :
Role :
Functionality :
SYNOPSIS
This script allows to document automatically existing script(s)/module(s) containing classes by generating the
corresponding UML Diagram.
SYNTAX
Write-CUClassDiagram [-Path] <String> [[-OutPutType] <Object>] [[-OutputFormat] <String>] [[-ExportFolder]
<String>] [-IgnoreCase] [-ShowComposition] [-Show] [-PassThru] [[-Exclude] <String[]>] [<CommonParameters>]
DESCRIPTION
Automatically generate a UML diagram of scripts/Modules that contain powershell classes.
PARAMETERS
-Path <String>
The path that contains the classes that need to be documented.
The path parameter should point to either a .ps1, .psm1 file, or a directory containing either/both of those
file types.
Required? true
Position? 1
Default value
Accept pipeline input? false
Accept wildcard characters? false
-OutPutType <Object>
OutPutType is a Set of 2 variables: Combined, Unique
Combined, all files present in a directory are drawn in the same graph.
Unique, all files present in a directory are drawn in their own graph.
Required? false
Position? 2
Default value Combined
Accept pipeline input? false
Accept wildcard characters? false
-OutputFormat <String>
Using the parameter OutputFormat, it is possible change the default output format (.png) to one of the
following ones:
'jpg', 'png', 'gif', 'imap', 'cmapx', 'jp2', 'json', 'pdf', 'plain', 'dot'
Required? false
Position? 3
Default value png
Accept pipeline input? false
Accept wildcard characters? false
-ExportFolder <String>
This optional parameter, allows to specifiy an alternative export folder. By default, the diagram is created
in the same folder as the source file.
Required? false
Position? 4
Default value
Accept pipeline input? false
Accept wildcard characters? false
-IgnoreCase [<SwitchParameter>]
By default, Class names MUST be case identical to have the Write-CUClassDiagram cmdlet generate the correct
inheritence tree.
When the switch -IgnoreCase is specified, All class names will be converted to 'Titlecase' to force the case,
and ensure the inheritence is correctly drawed in the Class Diagram.
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
-ShowComposition [<SwitchParameter>]
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
-Show [<SwitchParameter>]
Open's the generated diagram immediatly
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
-PassThru [<SwitchParameter>]
When specified, the raw Graph in GraphViz format will be returned back in String format.
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
-Exclude <String[]>
Required? false
Position? 5
Default value
Accept pipeline input? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
OUTPUTS
NOTES
Author: Stephanevg / LxLeChat
www: https://github.com/Stephanevg https://github.com/LxLeChat
Report bugs or ask for feature requests here:
https://github.com/Stephanevg/PsClassUtils
-------------------------- EXAMPLE 1 --------------------------
PS C:\\>#Generate a UML diagram of the classes located in MyClass.Ps1
# The diagram will be automatically created in the same folder as the file that contains the classes (C:\\Classes).
Write-CUClassDiagram.ps1 -File C:\\Classes\\MyClass.ps1
-------------------------- EXAMPLE 2 --------------------------
PS C:\\>#Various output formats are available using the parameter "OutPutFormat"
Write-CUClassDiagram.ps1 -File C:\\Classes\\Logging.psm1 -ExportFolder C:\\admin\\ -OutputFormat gif
Directory: C:\\admin
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 12.06.2018 07:47 58293 Logging.gif
-------------------------- EXAMPLE 3 --------------------------
PS C:\\>Write-CUClassDiagram -Path "C:\\Modules\\PSClassUtils\\Classes\\Private\\" -Show
Will generate a diagram of all the private classes available in the Path specified, and immediatley show the
diagram.
RELATED LINKS
https://github.com/Stephanevg/PsClassUtils
CommonParameters : False
WorkflowCommonParameters : False
details : @{name=Write-CUInterfaceImplementation; noun=; verb=}
Syntax : @{syntaxItem=System.Object[]}
parameters : @{parameter=System.Object[]}
inputTypes : @{inputType=}
returnValues : @{returnValue=}
aliases : None
remarks : None
alertSet :
description :
examples :
Synopsis :
Write-CUInterfaceImplementation [[-Name] <string>] [[-InterfaceType] <type>]
ModuleName : PSClassUtils
nonTerminatingErrors :
xmlns:command : http://schemas.microsoft.com/maml/dev/command/2004/10
xmlns:dev : http://schemas.microsoft.com/maml/dev/2004/10
xmlns:maml : http://schemas.microsoft.com/maml/2004/10
Name : Write-CUInterfaceImplementation
Category : Function
Component :
Role :
Functionality :