Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/Codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
name: PSScriptAnalyzer
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5

- name: Run PSScriptAnalyzer
uses: microsoft/psscriptanalyzer-action@v1.1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/PSScriptAnalyzer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
name: Run PSScriptAnalyzer
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: lint
uses: devblackops/github-action-psscriptanalyzer@master
with:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/PSScriptAnalyzerSettings.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
'PSUseToExportFieldsInManifest',
'PSReviewUnusedParameter',
'PSUseDeclaredVarsMoreThanAssignments',
'PSAvoidGlobalVars'
'PSAvoidGlobalVars',
'PSAvoidUsingWriteHost'
)
}
10 changes: 7 additions & 3 deletions .github/workflows/Release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ on:

jobs:
publish-to-gallery:
runs-on: windows-2019
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Set PSRepository to Trusted for PowerShell Gallery
shell: pwsh
run: |
Expand All @@ -17,6 +17,10 @@ jobs:
shell: pwsh
run: |
Install-Module -Name AsBuiltReport.Core -Repository PSGallery -Force
- name: Install Diagrammer.Core module
shell: pwsh
run: |
Install-Module -Name Diagrammer.Core -Repository PSGallery -Force
- name: Test Module Manifest
shell: pwsh
run: |
Expand Down Expand Up @@ -45,7 +49,7 @@ jobs:
needs: publish-to-gallery
runs-on: ubuntu-latest
steps:
- uses: zentered/bluesky-post-action@v0.1.0
- uses: zentered/bluesky-post-action@v0.3.0
with:
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"
env:
Expand Down
18 changes: 17 additions & 1 deletion AsBuiltReport.VMware.Horizon.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,23 @@
"ShowHeaderFooter": true,
"ShowTableCaptions": true
},
"Options": {},
"Options": {
"EnableDiagrams": false,
"EnableDiagramDebug": false,
"DiagramColumnSize": 3,
"DiagramTheme": "White",
"DiagramWaterMark": "",
"DiagramType": {
"Infrastructure": true
},
"ExportDiagrams": false,
"ExportDiagramsFormat": [
"png"
],
"EnableDiagramSignature": false,
"SignatureAuthorName": "",
"SignatureCompanyName": ""
},
"InfoLevel": {
"_comment_": "0 = Disabled, 1 = Summary, 2 = Informative, 3 = Detailed",
"UsersAndGroups": {
Expand Down
8 changes: 6 additions & 2 deletions AsBuiltReport.VMware.Horizon.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
RootModule = 'AsBuiltReport.VMware.Horizon.psm1'

# Version number of this module.
ModuleVersion = '1.1.5'
ModuleVersion = '1.1.6'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down Expand Up @@ -54,7 +54,11 @@
RequiredModules = @(
@{
ModuleName = 'AsBuiltReport.Core';
ModuleVersion = '1.4.2'
ModuleVersion = '1.4.3'
}
@{
ModuleName = 'Diagrammer.Core';
ModuleVersion = '0.2.29'
}
)
# Assemblies that must be loaded prior to importing this module
Expand Down
25 changes: 24 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,30 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.1.5] - 2025-1-21
## [1.1.6] - 2025-09-13

### Added

- Include Diagrammer.Core module as a requirement.
- Introduce the necessary file structure to enable diagram generation.

### Changed

- Update AsBuiltReport.Core module requirement to v1.4.3.
- Upgrade actions/checkout to v5 in Codeql.yml and PSScriptAnalyzer.yml.
- Upgrade actions/bluesky-post-action to v0.3.0
- Modifie Release.yml to use windows-latest.
- Enhance Invoke-ASBuiltReport function with improved dependency version checks.
- Update CHANGELOG.md to reflect recent changes.
- This is the final release supporting VMware Horizon; future versions will support Omnissa only.

## [1.1.5.1] - 2025-03-13

### Fixed

- Fix `Get-RequiredModule` script function to properly check for installed VMware PowerCLI versions ([Fix #36](https://github.com/AsBuiltReport/AsBuiltReport.VMware.Horizon/issues/36))

## [1.1.5] - 2025-01-21

### Added

Expand Down
133 changes: 133 additions & 0 deletions Src/Private/Export-AbrDiagram.ps1
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 {}
}
61 changes: 61 additions & 0 deletions Src/Private/Get-AbrHRZInfrastructureDiagram.ps1
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 {}

}
Loading