Skip to content

Commit db9327f

Browse files
authored
Merge pull request #39 from AsBuiltReport/dev
v1.1.6 public release
2 parents 832b2a7 + 46e72d0 commit db9327f

14 files changed

+344
-48
lines changed

.github/workflows/Codeql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
name: PSScriptAnalyzer
2828
runs-on: ubuntu-latest
2929
steps:
30-
- uses: actions/checkout@v4
30+
- uses: actions/checkout@v5
3131

3232
- name: Run PSScriptAnalyzer
3333
uses: microsoft/[email protected]

.github/workflows/PSScriptAnalyzer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ jobs:
55
name: Run PSScriptAnalyzer
66
runs-on: ubuntu-latest
77
steps:
8-
- uses: actions/checkout@v4
8+
- uses: actions/checkout@v5
99
- name: lint
1010
uses: devblackops/github-action-psscriptanalyzer@master
1111
with:

.github/workflows/PSScriptAnalyzerSettings.psd1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
'PSUseToExportFieldsInManifest',
44
'PSReviewUnusedParameter',
55
'PSUseDeclaredVarsMoreThanAssignments',
6-
'PSAvoidGlobalVars'
6+
'PSAvoidGlobalVars',
7+
'PSAvoidUsingWriteHost'
78
)
89
}

.github/workflows/Release.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ on:
66

77
jobs:
88
publish-to-gallery:
9-
runs-on: windows-2019
9+
runs-on: windows-latest
1010
steps:
11-
- uses: actions/checkout@v4
11+
- uses: actions/checkout@v5
1212
- name: Set PSRepository to Trusted for PowerShell Gallery
1313
shell: pwsh
1414
run: |
@@ -17,6 +17,10 @@ jobs:
1717
shell: pwsh
1818
run: |
1919
Install-Module -Name AsBuiltReport.Core -Repository PSGallery -Force
20+
- name: Install Diagrammer.Core module
21+
shell: pwsh
22+
run: |
23+
Install-Module -Name Diagrammer.Core -Repository PSGallery -Force
2024
- name: Test Module Manifest
2125
shell: pwsh
2226
run: |
@@ -45,7 +49,7 @@ jobs:
4549
needs: publish-to-gallery
4650
runs-on: ubuntu-latest
4751
steps:
48-
- uses: zentered/bluesky-post-action@v0.1.0
52+
- uses: zentered/bluesky-post-action@v0.3.0
4953
with:
5054
post: "[New Release] ${{ github.event.repository.name }} ${{ github.event.release.tag_name }}! Check out what's new! ${{ github.event.release.html_url }} #Omnissa #VMware #Horizon #vExpert #AsBuiltReport #PowerShell"
5155
env:

AsBuiltReport.VMware.Horizon.json

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,23 @@
88
"ShowHeaderFooter": true,
99
"ShowTableCaptions": true
1010
},
11-
"Options": {},
11+
"Options": {
12+
"EnableDiagrams": false,
13+
"EnableDiagramDebug": false,
14+
"DiagramColumnSize": 3,
15+
"DiagramTheme": "White",
16+
"DiagramWaterMark": "",
17+
"DiagramType": {
18+
"Infrastructure": true
19+
},
20+
"ExportDiagrams": false,
21+
"ExportDiagramsFormat": [
22+
"png"
23+
],
24+
"EnableDiagramSignature": false,
25+
"SignatureAuthorName": "",
26+
"SignatureCompanyName": ""
27+
},
1228
"InfoLevel": {
1329
"_comment_": "0 = Disabled, 1 = Summary, 2 = Informative, 3 = Detailed",
1430
"UsersAndGroups": {

AsBuiltReport.VMware.Horizon.psd1

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
RootModule = 'AsBuiltReport.VMware.Horizon.psm1'
1313

1414
# Version number of this module.
15-
ModuleVersion = '1.1.5'
15+
ModuleVersion = '1.1.6'
1616

1717
# Supported PSEditions
1818
# CompatiblePSEditions = @()
@@ -54,7 +54,11 @@
5454
RequiredModules = @(
5555
@{
5656
ModuleName = 'AsBuiltReport.Core';
57-
ModuleVersion = '1.4.2'
57+
ModuleVersion = '1.4.3'
58+
}
59+
@{
60+
ModuleName = 'Diagrammer.Core';
61+
ModuleVersion = '0.2.29'
5862
}
5963
)
6064
# Assemblies that must be loaded prior to importing this module

CHANGELOG.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,30 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [1.1.5] - 2025-1-21
8+
## [1.1.6] - 2025-09-13
9+
10+
### Added
11+
12+
- Include Diagrammer.Core module as a requirement.
13+
- Introduce the necessary file structure to enable diagram generation.
14+
15+
### Changed
16+
17+
- Update AsBuiltReport.Core module requirement to v1.4.3.
18+
- Upgrade actions/checkout to v5 in Codeql.yml and PSScriptAnalyzer.yml.
19+
- Upgrade actions/bluesky-post-action to v0.3.0
20+
- Modifie Release.yml to use windows-latest.
21+
- Enhance Invoke-ASBuiltReport function with improved dependency version checks.
22+
- Update CHANGELOG.md to reflect recent changes.
23+
- This is the final release supporting VMware Horizon; future versions will support Omnissa only.
24+
25+
## [1.1.5.1] - 2025-03-13
26+
27+
### Fixed
28+
29+
- Fix `Get-RequiredModule` script function to properly check for installed VMware PowerCLI versions ([Fix #36](https://github.com/AsBuiltReport/AsBuiltReport.VMware.Horizon/issues/36))
30+
31+
## [1.1.5] - 2025-01-21
932

1033
### Added
1134

Src/Private/Export-AbrDiagram.ps1

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
function Export-AbrDiagram {
2+
<#
3+
.SYNOPSIS
4+
Function used to build the settings needed to call Export-Diagrammer (Diagrammer.Core)
5+
6+
.DESCRIPTION
7+
The Export-AbrDiagram function build the settings needed to call Export-Diagrammer (Diagrammer.Core)
8+
to export a diagram in PDF, PNG, SVG, or base64 formats using PSgraph.
9+
.NOTES
10+
Version: 0.1.1
11+
Author: AsBuiltReport Organization
12+
Twitter: @AsBuiltReport
13+
Github: AsBuiltReport
14+
15+
.LINK
16+
https://github.com/AsBuiltReport/AsBuiltReport.VMware.Horizon
17+
#>
18+
19+
# Don't remove this line (Don't touch it!)
20+
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingCmdletAliases", "", Scope = "Function")]
21+
22+
[CmdletBinding()]
23+
param (
24+
$DiagramObject,
25+
[string] $MainDiagramLabel = 'Change Me',
26+
[Parameter(Mandatory = $true)]
27+
[string] $FileName,
28+
[string] $Orientation = 'Portrait'
29+
)
30+
31+
begin {
32+
Write-PScriboMessage -Message "EnableDiagrams set to $($Options.EnableDiagrams)."
33+
}
34+
35+
process {
36+
if ($Options.EnableDiagrams) {
37+
Write-PScriboMessage -Message "Loading export diagram settings"
38+
39+
$RootPath = Split-Path (Split-Path $PSScriptRoot -Parent) -Parent
40+
[System.IO.FileInfo]$IconPath = Join-Path -Path $RootPath -ChildPath 'icons'
41+
42+
$DiagramParams = @{
43+
'FileName' = $FileName
44+
'OutputFolderPath' = $OutputFolderPath
45+
'MainDiagramLabel' = $MainDiagramLabel
46+
'MainDiagramLabelFontsize' = 28
47+
'MainDiagramLabelFontcolor' = '#565656'
48+
'MainDiagramLabelFontname' = 'Segoe UI Black'
49+
'IconPath' = $IconPath
50+
'ImagesObj' = $Images
51+
'LogoName' = 'AsBuiltReport_LOGO'
52+
'SignatureLogoName' = 'AsBuiltReport_Signature'
53+
'WaterMarkText' = $Options.DiagramWaterMark
54+
'Direction' = 'top-to-bottom'
55+
}
56+
57+
if ($Options.DiagramTheme -eq 'Black') {
58+
$DiagramParams.add('MainGraphBGColor', 'Black')
59+
$DiagramParams.add('Edgecolor', 'White')
60+
$DiagramParams.add('Fontcolor', 'White')
61+
$DiagramParams.add('NodeFontcolor', 'White')
62+
$DiagramParams.add('WaterMarkColor', 'White')
63+
} elseif ($Options.DiagramTheme -eq 'Neon') {
64+
$DiagramParams.add('MainGraphBGColor', 'grey14')
65+
$DiagramParams.add('Edgecolor', 'gold2')
66+
$DiagramParams.add('Fontcolor', 'gold2')
67+
$DiagramParams.add('NodeFontcolor', 'gold2')
68+
$DiagramParams.add('WaterMarkColor', '#FFD700')
69+
} else {
70+
$DiagramParams.add('WaterMarkColor', '#333333')
71+
}
72+
73+
if ($Options.ExportDiagrams) {
74+
if (-not $Options.ExportDiagramsFormat) {
75+
$DiagramFormat = 'png'
76+
} else {
77+
$DiagramFormat = $Options.ExportDiagramsFormat
78+
}
79+
$DiagramParams.Add('Format', $DiagramFormat)
80+
} else {
81+
$DiagramParams.Add('Format', "base64")
82+
}
83+
84+
if ($Options.EnableDiagramDebug) {
85+
86+
$DiagramParams.Add('DraftMode', $True)
87+
88+
}
89+
90+
if ($Options.EnableDiagramSignature) {
91+
$DiagramParams.Add('Signature', $True)
92+
$DiagramParams.Add('AuthorName', $Options.SignatureAuthorName)
93+
$DiagramParams.Add('CompanyName', $Options.SignatureCompanyName)
94+
}
95+
96+
if ($Options.ExportDiagrams) {
97+
try {
98+
Write-PScriboMessage -Message "Generating $MainDiagramLabel diagram"
99+
$Graph = $DiagramObject
100+
if ($Graph) {
101+
Write-PScriboMessage -Message "Saving $MainDiagramLabel diagram"
102+
$Diagram = New-Diagrammer @DiagramParams -InputObject $Graph
103+
if ($Diagram) {
104+
foreach ($OutputFormat in $DiagramFormat) {
105+
Write-Information -MessageData "Saved '$($FileName).$($OutputFormat)' diagram to '$($OutputFolderPath)'." -InformationAction Continue
106+
}
107+
}
108+
}
109+
} catch {
110+
Write-PScriboMessage -IsWarning -Message "Unable to export the $MainDiagramLabel Diagram: $($_.Exception.Message)"
111+
}
112+
}
113+
try {
114+
$DiagramParams.Remove('Format')
115+
$DiagramParams.Add('Format', "base64")
116+
117+
$Graph = $DiagramObject
118+
$Diagram = New-Diagrammer @DiagramParams -InputObject $Graph
119+
if ($Diagram) {
120+
if ((Get-DiaImagePercent -GraphObj $Diagram).Width -gt 600) { $ImagePrty = 30 } else { $ImagePrty = 50 }
121+
Section -Style Heading2 $MainDiagramLabel -Orientation $Orientation {
122+
Image -Base64 $Diagram -Text "$MainDiagramLabel" -Percent $ImagePrty -Align Center
123+
Paragraph "Image preview: Opens the image in a new tab to view it at full resolution." -Tabs 2
124+
}
125+
}
126+
} catch {
127+
Write-PScriboMessage -IsWarning -Message "Unable to generate the $MainDiagramLabel Diagram: $($_.Exception.Message)"
128+
}
129+
}
130+
}
131+
132+
end {}
133+
}
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
function Get-AbrVmmInfrastructureDiagram {
2+
<#
3+
.SYNOPSIS
4+
Used by As Built Report to built VMM infrastructure diagram
5+
.DESCRIPTION
6+
7+
.NOTES
8+
Version: 0.1.1
9+
Author: AsBuiltReport Organization
10+
Twitter: @AsBuiltReport
11+
Github: AsBuiltReport
12+
.EXAMPLE
13+
14+
.LINK
15+
16+
#>
17+
[CmdletBinding()]
18+
param (
19+
)
20+
21+
begin {
22+
Write-PScriboMessage "Generating Infrastructure Diagram for Horizon."
23+
# Used for DraftMode (Don't touch it!)
24+
if ($Options.EnableDiagramDebug) {
25+
$EdgeDebug = @{style = 'filled'; color = 'red' }
26+
$SubGraphDebug = @{style = 'dashed'; color = 'red' }
27+
$NodeDebug = @{color = 'black'; style = 'red'; shape = 'plain' }
28+
$NodeDebugEdge = @{color = 'black'; style = 'red'; shape = 'plain' }
29+
$IconDebug = $true
30+
} else {
31+
$EdgeDebug = @{style = 'invis'; color = 'red' }
32+
$SubGraphDebug = @{style = 'invis'; color = 'gray' }
33+
$NodeDebug = @{color = 'transparent'; style = 'transparent'; shape = 'point' }
34+
$NodeDebugEdge = @{color = 'transparent'; style = 'transparent'; shape = 'none' }
35+
$IconDebug = $false
36+
}
37+
38+
# Used for setting diagram Theme (Can be change to fits your needs!)
39+
if ($Options.DiagramTheme -eq 'Black') {
40+
$Edgecolor = 'White'
41+
$Fontcolor = 'White'
42+
} elseif ($Options.DiagramTheme -eq 'Neon') {
43+
$Edgecolor = 'gold2'
44+
$Fontcolor = 'gold2'
45+
} else {
46+
$Edgecolor = '#71797E'
47+
$Fontcolor = '#565656'
48+
}
49+
}
50+
51+
process {
52+
try {
53+
54+
} catch {
55+
Write-PScriboMessage -IsWarning $_.Exception.Message
56+
}
57+
}
58+
59+
end {}
60+
61+
}

0 commit comments

Comments
 (0)