Skip to content

Commit 81a03a3

Browse files
committed
Final updates to v1.2.0
* Add option to enable/disable TOC in report config * Update supported versions in `Readme.md` * Fix table formatting for Tags, Tag Categories, Tagg Assignments * Add check for VMware PowerCLI install
1 parent 92c7e11 commit 81a03a3

File tree

4 files changed

+25
-15
lines changed

4 files changed

+25
-15
lines changed

AsBuiltReport.VMware.vSphere.Style.ps1

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ Table -Name 'Cover Page' -List -Style Borderless -Width 0 -Hashtable ([Ordered]
9191
})
9292
PageBreak
9393

94-
# Add Table of Contents
95-
TOC -Name 'Table of Contents'
96-
PageBreak
94+
if ($ReportConfig.Report.ShowTableOfContents) {
95+
# Add Table of Contents
96+
TOC -Name 'Table of Contents'
97+
PageBreak
98+
}

AsBuiltReport.VMware.vSphere.json

76 Bytes
Binary file not shown.

README.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ Below are the instructions on how to install, configure and generate a VMware vS
4343

4444
### VMware vSphere
4545
The VMware vSphere As Built Report supports the following vSphere versions;
46-
- vSphere 5.0
47-
- vSphere 5.1
4846
- vSphere 5.5
4947
- vSphere 6.0
5048
- vSphere 6.5
@@ -107,14 +105,15 @@ The following provides information of how to configure each schema within the re
107105
### Report
108106
The **Report** schema provides configuration of the vSphere report information.
109107

110-
| Sub-Schema | Setting | Default | Description |
111-
|--------------------|--------------|--------------------------------|--------------------------------------------------------------|
112-
| Name | User defined | VMware vSphere As Built Report | The name of the As Built Report |
113-
| Version | User defined | 1.0 | The report version |
114-
| Status | User defined | Released | The report release status |
115-
| ShowCoverPageImage | true / false | true | Toggle to enable/disable the display of the cover page image |
116-
| ShowHeaderFooter | true / false | true | Toggle to enable/disable document headers & footers |
117-
| ShowTableCaptions | true / false | true | Toggle to enable/disable table captions/numbering |
108+
| Sub-Schema | Setting | Default | Description |
109+
|---------------------|--------------|--------------------------------|--------------------------------------------------------------|
110+
| Name | User defined | VMware vSphere As Built Report | The name of the As Built Report |
111+
| Version | User defined | 1.0 | The report version |
112+
| Status | User defined | Released | The report release status |
113+
| ShowCoverPageImage | true / false | true | Toggle to enable/disable the display of the cover page image |
114+
| ShowTableOfContents | true / false | true | Toggle to enable/disable table of contents |
115+
| ShowHeaderFooter | true / false | true | Toggle to enable/disable document headers & footers |
116+
| ShowTableCaptions | true / false | true | Toggle to enable/disable table captions/numbering |
118117

119118
### Options
120119
The **Options** schema allows certain options within the report to be toggled on or off.

Src/Public/Invoke-AsBuiltReport.VMware.vSphere.ps1

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ function Invoke-AsBuiltReport.VMware.vSphere {
1919
[PSCredential] $Credential
2020
)
2121

22+
# Check if VMware PowerCLI 10.0 or higher is installed
23+
$RequiredModules = Get-Module -ListAvailable -Name 'VMware.PowerCLI' | Sort-Object -Property Version -Descending | Select-Object -First 1
24+
if ($RequiredModules.Version.Major -lt 10) {
25+
Write-Warning -Message "VMware PowerCLI 10.0 or higher is required to run the VMware vSphere As Built Report. Run 'Install-Module -Name VMware.PowerCLI -MinimumVersion 10.0' to install the required modules."
26+
break
27+
}
28+
2229
# Import Report Configuration
2330
$Report = $ReportConfig.Report
2431
$InfoLevel = $ReportConfig.InfoLevel
@@ -336,6 +343,7 @@ function Invoke-AsBuiltReport.VMware.vSphere {
336343
}
337344
$TableParams = @{
338345
Name = "Tags - $vCenterServerName"
346+
ColumnWidths = 30, 40, 30
339347
}
340348
if ($Report.ShowTableCaptions) {
341349
$TableParams['Caption'] = "- $($TableParams.Name)"
@@ -358,7 +366,7 @@ function Invoke-AsBuiltReport.VMware.vSphere {
358366
}
359367
$TableParams = @{
360368
Name = "Tag Categories - $vCenterServerName"
361-
ColumnWidths = 40, 40, 20
369+
ColumnWidths = 30, 40, 30
362370
}
363371
if ($Report.ShowTableCaptions) {
364372
$TableParams['Caption'] = "- $($TableParams.Name)"
@@ -381,6 +389,7 @@ function Invoke-AsBuiltReport.VMware.vSphere {
381389
}
382390
$TableParams = @{
383391
Name = "Tag Assignments - $vCenterServerName"
392+
ColumnWidths = 30, 40, 30
384393
}
385394
if ($Report.ShowTableCaptions) {
386395
$TableParams['Caption'] = "- $($TableParams.Name)"
@@ -1469,7 +1478,7 @@ function Invoke-AsBuiltReport.VMware.vSphere {
14691478
}
14701479
$TableParams = @{
14711480
Name = "Permissions - $Cluster"
1472-
ColumnWidths = 50, 8, 16, 14, 12
1481+
ColumnWidths = 42, 12, 20, 14, 12
14731482
}
14741483
if ($Report.ShowTableCaptions) {
14751484
$TableParams['Caption'] = "- $($TableParams.Name)"

0 commit comments

Comments
 (0)