AsBuiltReport.Diagram is a PowerShell module that provides a foundational framework for creating as-built diagrams of various datacenter systems. It serves as a required dependency for individual diagrammer modules, which generate diagrams tailored to specific products or technologies.
The following simple list of instructions will get you started with the AsBuiltReport.Diagram module.
This module is compatible with the following PowerShell versions;
| Windows PowerShell 5.1 | Windows/Linux/MacOs PowerShell 7 |
|---|---|
| β | β |
PowerShell 5.1/7, and the following PowerShell modules are required for generating a AsBuiltReport.Diagram diagram.
For an online installation, install the AsBuiltReport.Diagram module using the PowerShell Gallery;
# Install AsBuiltReport.Diagram module
Install-Module -Name 'AsBuiltReport.Diagram' -Repository 'PSGallery' -Scope 'CurrentUser'For an offline installation, perform the following steps from a machine with internet connectivity;
Save the required AsBuiltReport.Diagram module to a specified folder.
# Save AsBuiltReport.Diagram module
Save-Module -Name 'AsBuiltReport.Diagram' -Repository 'PSGallery' -Path '<Folder Path>'Copy the downloaded AsBuiltReport.Diagram module folder to a location that can be made accessible to the offline system.
e.g. USB Flash Drive, Internal File Share etc.
On the offline system, open a PowerShell console window and run the following command to determine the PowerShell module path.
Windows
$env:PSModulePath -Split ';'Copy the downloaded AsBuiltReport.Diagram module folder to a folder specified in the $env:PSModulePath output.
If you are unable to use the PowerShell Gallery, you can still install the AsBuiltReport.Diagram module manually. Ensure you repeat the following steps for the system requirements also.
- Download the latest release zip from GitHub
- Extract the zip file
- Copy the folder
AsBuiltReport.Diagramto a path that is set in$env:PSModulePath. - For Windows users only, open a PowerShell terminal window and unblock the downloaded files with
$path = (Get-Module -Name AsBuiltReport.Diagram -ListAvailable).ModuleBase; Unblock-File -Path $path\*.psd1; Unblock-File -Path $path\Src\Public\*.ps1; Unblock-File -Path $path\Src\Private\*.ps1
- Close and reopen the PowerShell terminal window.
Note: You are not limited to installing the module to those example paths, you can add a new entry to the environment variable PSModulePath if you want to use another path.
Linux & MacOs require the installation of Graphviz to be able to generate the diagram:
Linux
sudo apt install graphvizsudo dnf install graphvizMacOs
"MacPorts* provides both stable and development versions of Graphviz and the Mac GUI Graphviz.app. These can be obtained via the ports graphviz, graphviz-devel, graphviz-gui and graphviz-gui-devel."
sudo port install graphvizbrew install graphvizThe documentation for the AsBuiltReport.Diagram module can be found in the Docs.
All commands in the latest release of AsBuiltReport.Diagram can be found in the table below, each with a link to their documentation page.
| Name | Description | Version |
|---|---|---|
| Add-DiaCrossShapeLine | Adds a line between two cross shapes | 0.2.31 |
| Add-DiaNodeIcon | Adds an icon to a node | 0.2.31 |
| Add-DiaNodeEdge | Adds an edge between two nodes | 0.2.39 |
| Add-DiaHTMLLabel | Adds an HTML label to the diagram | 0.2.31 |
| Add-DiaHTMLNodeTable | Adds an HTML node table to the diagram | 0.2.31 |
| Add-DiaHtmlSignatureTable | Adds an HTML signature table to the diagram | 0.2.31 |
| Add-DiaHTMLSubGraph | Adds an HTML subgraph to the diagram | 0.2.31 |
| Add-DiaHTMLTable | Adds an HTML table to the diagram | 0.2.31 |
| Add-DiaInvertedLShapeLine | Adds a line between two inverted L shapes | 0.2.31 |
| Add-DiaInvertedTShapeLine | Adds a line between two inverted T shapes | 0.2.31 |
| Add-DiaLeftLShapeLine | Adds a line between two left L shapes | 0.2.31 |
| Add-DiaLeftTShapeLine | Adds a line between two left T shapes | 0.2.31 |
| Add-DiaLShapeLine | Adds a line between two L shapes | 0.2.31 |
| Add-DiaNodeImage | Adds an image to a node | 0.2.31 |
| Add-DiaNodeShape | Adds a shape to a node | 0.2.31 |
| Add-DiaNodeSpacer | Adds a spacer to a node | 0.2.31 |
| Add-DiaRightLShapeLine | Adds a line between two right L shapes | 0.2.31 |
| Add-DiaRightTShapeLine | Adds a line between two right T shapes | 0.2.31 |
| Add-DiaTShapeLine | Adds a line between two T shapes | 0.2.31 |
| Add-DiaVerticalLine | Adds a vertical line between two nodes | 0.2.31 |
| Export-Diagrammer | Exports the diagram to a file | 0.2.31 |
| Get-RandomColorHex | Gets a random color in hex format | 0.2.31 |
| Get-RandomPastelColorHex | Gets a random pastel color in hex format | 0.2.31 |
| New-Diagrammer | Creates a new diagram from an input object | 0.2.31 |
All examples in the latest release of AsBuiltReport.Diagram can be found in the table below, each with a link to their documentation page.
| Name | Description | Module |
|---|---|---|
| Example1 | Node cmdlet | PSGraph |
| Example2 | Edge cmdlet | PSGraph |
| Example3 | Edge minlen attribute | PSGraph |
| Example4 | SubGraph cmdlet | PSGraph |
| Example5 | Add-DiaNodeIcon cmdlet | AsBuiltReport.Diagram |
| Example6 | DraftMode feature | AsBuiltReport.Diagram |
| Example7 | Rank cmdlet | PSGraph |
| Example8 | Add-DiaHTMLNodeTable cmdlet | AsBuiltReport.Diagram |
| Example9 | Add-DiaHTMLNodeTable MultiIcon feature | AsBuiltReport.Diagram |
| Example10 | Add-DiaNodeImage cmdlet | AsBuiltReport.Diagram |
| Example11 | Add-DiaHTMLTable cmdlet | AsBuiltReport.Diagram |
| Example12 | WaterMark feature | AsBuiltReport.Diagram |
| Example13 | Signature feature | AsBuiltReport.Diagram |
| Example14 | Add-DiaNodeShape cmdlet | AsBuiltReport.Diagram |
| Example15 | Add-DiaNodeSpacer cmdlet | AsBuiltReport.Diagram |
| AdvancedExample1 | Add-DiaHTMLSubGraph cmdlet | AsBuiltReport.Diagram |
| AdvancedExample2 | Add-DiaNodeText cmdlet | AsBuiltReport.Diagram |