-
Notifications
You must be signed in to change notification settings - Fork 5
v1.1.6 public release #39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
d1924ad
Fix Get-RequiredModule function
tpcarman 4ffde8b
Fix code formatting
tpcarman 0075a98
Merge pull request #37 from tpcarman/dev
rebelinux 065459c
feat: Enhance diagram support and update module dependencies
rebelinux e62a73d
Delete files
rebelinux e4ba22f
fix: Correct module version in manifest and update changelog for vers…
rebelinux 8001277
fix: Disable diagram generation in options
rebelinux 46e72d0
Merge pull request #38 from rebelinux/dev
rebelinux File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,133 @@ | ||
| function Export-AbrDiagram { | ||
| <# | ||
| .SYNOPSIS | ||
| Function used to build the settings needed to call Export-Diagrammer (Diagrammer.Core) | ||
|
|
||
| .DESCRIPTION | ||
| The Export-AbrDiagram function build the settings needed to call Export-Diagrammer (Diagrammer.Core) | ||
| to export a diagram in PDF, PNG, SVG, or base64 formats using PSgraph. | ||
| .NOTES | ||
| Version: 0.1.1 | ||
| Author: AsBuiltReport Organization | ||
| Twitter: @AsBuiltReport | ||
| Github: AsBuiltReport | ||
|
|
||
| .LINK | ||
| https://github.com/AsBuiltReport/AsBuiltReport.VMware.Horizon | ||
| #> | ||
|
|
||
| # Don't remove this line (Don't touch it!) | ||
| [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingCmdletAliases", "", Scope = "Function")] | ||
|
|
||
| [CmdletBinding()] | ||
| param ( | ||
| $DiagramObject, | ||
| [string] $MainDiagramLabel = 'Change Me', | ||
| [Parameter(Mandatory = $true)] | ||
| [string] $FileName, | ||
| [string] $Orientation = 'Portrait' | ||
| ) | ||
|
|
||
| begin { | ||
| Write-PScriboMessage -Message "EnableDiagrams set to $($Options.EnableDiagrams)." | ||
| } | ||
|
|
||
| process { | ||
| if ($Options.EnableDiagrams) { | ||
| Write-PScriboMessage -Message "Loading export diagram settings" | ||
|
|
||
| $RootPath = Split-Path (Split-Path $PSScriptRoot -Parent) -Parent | ||
| [System.IO.FileInfo]$IconPath = Join-Path -Path $RootPath -ChildPath 'icons' | ||
|
|
||
| $DiagramParams = @{ | ||
| 'FileName' = $FileName | ||
| 'OutputFolderPath' = $OutputFolderPath | ||
| 'MainDiagramLabel' = $MainDiagramLabel | ||
| 'MainDiagramLabelFontsize' = 28 | ||
| 'MainDiagramLabelFontcolor' = '#565656' | ||
| 'MainDiagramLabelFontname' = 'Segoe UI Black' | ||
| 'IconPath' = $IconPath | ||
| 'ImagesObj' = $Images | ||
| 'LogoName' = 'AsBuiltReport_LOGO' | ||
| 'SignatureLogoName' = 'AsBuiltReport_Signature' | ||
| 'WaterMarkText' = $Options.DiagramWaterMark | ||
| 'Direction' = 'top-to-bottom' | ||
| } | ||
|
|
||
| if ($Options.DiagramTheme -eq 'Black') { | ||
| $DiagramParams.add('MainGraphBGColor', 'Black') | ||
| $DiagramParams.add('Edgecolor', 'White') | ||
| $DiagramParams.add('Fontcolor', 'White') | ||
| $DiagramParams.add('NodeFontcolor', 'White') | ||
| $DiagramParams.add('WaterMarkColor', 'White') | ||
| } elseif ($Options.DiagramTheme -eq 'Neon') { | ||
| $DiagramParams.add('MainGraphBGColor', 'grey14') | ||
| $DiagramParams.add('Edgecolor', 'gold2') | ||
| $DiagramParams.add('Fontcolor', 'gold2') | ||
| $DiagramParams.add('NodeFontcolor', 'gold2') | ||
| $DiagramParams.add('WaterMarkColor', '#FFD700') | ||
| } else { | ||
| $DiagramParams.add('WaterMarkColor', '#333333') | ||
| } | ||
|
|
||
| if ($Options.ExportDiagrams) { | ||
| if (-not $Options.ExportDiagramsFormat) { | ||
| $DiagramFormat = 'png' | ||
| } else { | ||
| $DiagramFormat = $Options.ExportDiagramsFormat | ||
| } | ||
| $DiagramParams.Add('Format', $DiagramFormat) | ||
| } else { | ||
| $DiagramParams.Add('Format', "base64") | ||
| } | ||
|
|
||
| if ($Options.EnableDiagramDebug) { | ||
|
|
||
| $DiagramParams.Add('DraftMode', $True) | ||
|
|
||
| } | ||
|
|
||
| if ($Options.EnableDiagramSignature) { | ||
| $DiagramParams.Add('Signature', $True) | ||
| $DiagramParams.Add('AuthorName', $Options.SignatureAuthorName) | ||
| $DiagramParams.Add('CompanyName', $Options.SignatureCompanyName) | ||
| } | ||
|
|
||
| if ($Options.ExportDiagrams) { | ||
| try { | ||
| Write-PScriboMessage -Message "Generating $MainDiagramLabel diagram" | ||
| $Graph = $DiagramObject | ||
| if ($Graph) { | ||
| Write-PScriboMessage -Message "Saving $MainDiagramLabel diagram" | ||
| $Diagram = New-Diagrammer @DiagramParams -InputObject $Graph | ||
| if ($Diagram) { | ||
| foreach ($OutputFormat in $DiagramFormat) { | ||
| Write-Information -MessageData "Saved '$($FileName).$($OutputFormat)' diagram to '$($OutputFolderPath)'." -InformationAction Continue | ||
| } | ||
| } | ||
| } | ||
| } catch { | ||
| Write-PScriboMessage -IsWarning -Message "Unable to export the $MainDiagramLabel Diagram: $($_.Exception.Message)" | ||
| } | ||
| } | ||
| try { | ||
| $DiagramParams.Remove('Format') | ||
| $DiagramParams.Add('Format', "base64") | ||
|
|
||
| $Graph = $DiagramObject | ||
| $Diagram = New-Diagrammer @DiagramParams -InputObject $Graph | ||
| if ($Diagram) { | ||
| if ((Get-DiaImagePercent -GraphObj $Diagram).Width -gt 600) { $ImagePrty = 30 } else { $ImagePrty = 50 } | ||
| Section -Style Heading2 $MainDiagramLabel -Orientation $Orientation { | ||
| Image -Base64 $Diagram -Text "$MainDiagramLabel" -Percent $ImagePrty -Align Center | ||
| Paragraph "Image preview: Opens the image in a new tab to view it at full resolution." -Tabs 2 | ||
| } | ||
| } | ||
| } catch { | ||
| Write-PScriboMessage -IsWarning -Message "Unable to generate the $MainDiagramLabel Diagram: $($_.Exception.Message)" | ||
| } | ||
| } | ||
| } | ||
|
|
||
| end {} | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| function Get-AbrVmmInfrastructureDiagram { | ||
| <# | ||
| .SYNOPSIS | ||
| Used by As Built Report to built VMM infrastructure diagram | ||
| .DESCRIPTION | ||
|
|
||
| .NOTES | ||
| Version: 0.1.1 | ||
| Author: AsBuiltReport Organization | ||
| Twitter: @AsBuiltReport | ||
| Github: AsBuiltReport | ||
| .EXAMPLE | ||
|
|
||
| .LINK | ||
|
|
||
| #> | ||
| [CmdletBinding()] | ||
| param ( | ||
| ) | ||
|
|
||
| begin { | ||
| Write-PScriboMessage "Generating Infrastructure Diagram for Horizon." | ||
| # Used for DraftMode (Don't touch it!) | ||
| if ($Options.EnableDiagramDebug) { | ||
| $EdgeDebug = @{style = 'filled'; color = 'red' } | ||
| $SubGraphDebug = @{style = 'dashed'; color = 'red' } | ||
|
||
| $NodeDebug = @{color = 'black'; style = 'red'; shape = 'plain' } | ||
|
||
| $NodeDebugEdge = @{color = 'black'; style = 'red'; shape = 'plain' } | ||
|
||
| $IconDebug = $true | ||
|
||
| } else { | ||
| $EdgeDebug = @{style = 'invis'; color = 'red' } | ||
| $SubGraphDebug = @{style = 'invis'; color = 'gray' } | ||
| $NodeDebug = @{color = 'transparent'; style = 'transparent'; shape = 'point' } | ||
| $NodeDebugEdge = @{color = 'transparent'; style = 'transparent'; shape = 'none' } | ||
| $IconDebug = $false | ||
| } | ||
|
|
||
| # Used for setting diagram Theme (Can be change to fits your needs!) | ||
| if ($Options.DiagramTheme -eq 'Black') { | ||
| $Edgecolor = 'White' | ||
|
||
| $Fontcolor = 'White' | ||
|
||
| } elseif ($Options.DiagramTheme -eq 'Neon') { | ||
| $Edgecolor = 'gold2' | ||
| $Fontcolor = 'gold2' | ||
| } else { | ||
| $Edgecolor = '#71797E' | ||
| $Fontcolor = '#565656' | ||
| } | ||
| } | ||
|
|
||
| process { | ||
| try { | ||
|
|
||
| } catch { | ||
| Write-PScriboMessage -IsWarning $_.Exception.Message | ||
| } | ||
| } | ||
|
|
||
| end {} | ||
|
|
||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.