Skip to content

Commit

Permalink
fix: report output failing (#217)
Browse files Browse the repository at this point in the history
Updated `Invoke-*Report` cmdlets to handle `.` or `-` in the report path.
  • Loading branch information
GaryJBlake authored and tenthirtyam committed May 23, 2024
1 parent 8a7eb5d commit 61bdbce
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 59 deletions.
14 changes: 13 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
# Release History

## v2.6.2

> Release Date: 2024-05-28
Bugfix:

- Updated `Invoke-VcfHealthReport` cmdlet to handle `.` or `-` in the report path. [GH-217](https://github.com/vmware/powershell-module-for-vmware-cloud-foundation-reporting/pull/217)
- Updated `Invoke-VcfAlertReport` cmdlet to handle `.` or `-` in the report path. [GH-217](https://github.com/vmware/powershell-module-for-vmware-cloud-foundation-reporting/pull/217)
- Updated `Invoke-VcfConfigReport` cmdlet to handle `.` or `-` in the report path. [GH-217](https://github.com/vmware/powershell-module-for-vmware-cloud-foundation-reporting/pull/217)
- Updated `Invoke-VcfUpgradePrecheck` cmdlet to handle `.` or `-` in the report path. [GH-217](https://github.com/vmware/powershell-module-for-vmware-cloud-foundation-reporting/pull/217)
- Updated `Invoke-VcfOverviewReport` cmdlet to handle `.` or `-` in the report path. [GH-217](https://github.com/vmware/powershell-module-for-vmware-cloud-foundation-reporting/pull/217)

## v2.6.1

> Release Date: 2024-02-06
Bugfix:

- Updated `Request-VcenterStorageHealth` cmdlet to output an error message if authentication to vCenter Server fails. [GH-209](https://github.com/vmware/powershell-module-for-vmware-cloud-foundation-reporting/pull/209)

## v2.6.0

> Release Date: 2024-01-30
Expand Down
106 changes: 53 additions & 53 deletions VMware.CloudFoundation.Reporting.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -3,57 +3,57 @@

# Module manifest for module 'VMware.CloudFoundation.Reporting'
# Generated by: Broadcom
# Generated on: 2024-02-06
# Generated on: 2024-05-28

@{

# Script module or binary module file associated with this manifest.
RootModule = '.\VMware.CloudFoundation.Reporting.psm1'
RootModule = '.\VMware.CloudFoundation.Reporting.psm1'

# Version number of this module.
ModuleVersion = '2.6.1.1001'
ModuleVersion = '2.6.2.1000'

# Supported PSEditions
# CompatiblePSEditions = @()

# ID used to uniquely identify this module
GUID = '043bbd4d-206a-4520-87f5-070450379d72'
GUID = '043bbd4d-206a-4520-87f5-070450379d72'

# Author of this module
Author = 'Broadcom'
Author = 'Broadcom'

# Company or vendor of this module
CompanyName = 'Broadcom'
CompanyName = 'Broadcom'

# Copyright statement for this module
Copyright = 'Copyright 2023-2024 Broadcom. All Rights Reserved.'
Copyright = 'Copyright 2023-2024 Broadcom. All Rights Reserved.'

# Description of the functionality provided by this module
Description = 'PowerShell Module for VMware Cloud Foundation Reporting'
Description = 'PowerShell Module for VMware Cloud Foundation Reporting'

# Minimum version of the PowerShell engine required by this module
PowerShellVersion = '7.2.0'

# Name of the PowerShell host required by this module
# PowerShellHostName = ''

# Minimum version of the PowerShell host required by this module
# PowerShellHostVersion = ''

# Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
# DotNetFrameworkVersion = ''

# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
# ClrVersion = ''

# Processor architecture (None, X86, Amd64) required by this module
# ProcessorArchitecture = ''

# Modules that must be imported into the global environment prior to importing this module
RequiredModules = @(
@{
ModuleName = 'VMware.vSphere.SsoAdmin'
ModuleVersion = '1.3.9'
ModuleVersion = '1.3.9'
}
@{
ModuleName = 'PowerVCF'
Expand All @@ -64,80 +64,80 @@
ModuleVersion = '2.8.0'
}
)

# Assemblies that must be loaded prior to importing this module
# RequiredAssemblies = @()

# Script files (.ps1) that are run in the caller's environment prior to importing this module.
# ScriptsToProcess = @()

# Type files (.ps1xml) to be loaded when importing this module
# TypesToProcess = @()

# Format files (.ps1xml) to be loaded when importing this module
# FormatsToProcess = @()

# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
# NestedModules = @()

# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
FunctionsToExport = '*'

# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
CmdletsToExport = '*'
CmdletsToExport = '*'

# Variables to export from this module
VariablesToExport = '*'

# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export.
AliasesToExport = '*'
AliasesToExport = '*'

# DSC resources to export from this module
# DscResourcesToExport = @()

# List of all modules packaged with this module
# ModuleList = @()

# List of all files packaged with this module
# FileList = @()

# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell.
PrivateData = @{
PrivateData = @{

PSData = @{

# Tags applied to this module. These help with module discovery in online galleries.
Tags = @('VMware', 'CloudFoundation', 'VMwareCloudFoundation')

# A URL to the license for this module.
LicenseUri = 'https://github.com/vmware/powershell-module-for-vmware-cloud-foundation-reporting/blob/main/LICENSE'

# A URL to the main website for this project.
ProjectUri = 'https://vmware.github.io/powershell-module-for-vmware-cloud-foundation-reporting'

# A URL to an icon representing this module.
IconUri = 'https://raw.githubusercontent.com/vmware/powershell-module-for-vmware-cloud-foundation-reporting/main/.github/icon-85px.svg'

# ReleaseNotes of this module
ReleaseNotes = 'https://vmware.github.io/powershell-module-for-vmware-cloud-foundation-reporting/release-notes/'

# Prerelease string of this module
# Prerelease = ''

# Flag to indicate whether the module requires explicit user acceptance for install/update/save
# RequireLicenseAcceptance = $false

# External dependent modules of this module
# ExternalModuleDependencies = @()

} # End of PSData hashtable

} # End of PrivateData hashtable

# HelpInfo URI of this module
# HelpInfoURI = ''

# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
# DefaultCommandPrefix = ''

}
10 changes: 5 additions & 5 deletions VMware.CloudFoundation.Reporting.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ Function Invoke-VcfHealthReport {
$defaultReport = Start-CreateReportDirectory -path $reportPath -reportType health # Setup Report Location and Report File
if (!(Test-Path -Path $reportPath)) {Write-Warning "Unable to locate report path $reportPath, enter a valid path and try again"; Write-Host ""; Break }
if ($PsBoundParameters.ContainsKey("allDomains")) {
$reportname = $defaultReport.Split('.')[0] + "-" + $sddcManagerFqdn.Split(".")[0] + ".htm"
$reportname = $defaultReport.Split('-health')[0] + "-health-" + $sddcManagerFqdn.Split(".")[0] + ".htm"
$reportData = "<h1>SDDC Manager: $sddcManagerFqdn</h1>"
$workflowMessage = "VMware Cloud Foundation instance ($sddcManagerFqdn)"
$commandSwitch = "-allDomains"
Expand Down Expand Up @@ -501,7 +501,7 @@ Function Invoke-VcfAlertReport {
$defaultReport = Start-CreateReportDirectory -path $reportPath -reportType alert # Setup Report Location and Report File
if (!(Test-Path -Path $reportPath)) {Write-Warning "Unable to locate report path $reportPath, enter a valid path and try again"; Write-Host ""; Break }
if ($PsBoundParameters.ContainsKey("allDomains")) {
$reportname = $defaultReport.Split('.')[0] + "-" + $sddcManagerFqdn.Split(".")[0] + ".htm"
$reportname = $defaultReport.Split('-alert')[0] + "-alert-" + $sddcManagerFqdn.Split(".")[0] + ".htm"
$reportData = "<h1>SDDC Manager: $sddcManagerFqdn</h1>"
$workflowMessage = "VMware Cloud Foundation instance ($sddcManagerFqdn)"
$commandSwitch = "-allDomains"
Expand Down Expand Up @@ -625,7 +625,7 @@ Function Invoke-VcfConfigReport {
$defaultReport = Start-CreateReportDirectory -path $reportPath -reportType config # Setup Report Location and Report File
if (!(Test-Path -Path $reportPath)) {Write-Warning "Unable to locate report path $reportPath, enter a valid path and try again"; Write-Host ""; Break }
if ($PsBoundParameters.ContainsKey("allDomains")) {
$reportname = $defaultReport.Split('.')[0] + "-" + $sddcManagerFqdn.Split(".")[0] + ".htm"
$reportname = $defaultReport.Split('-config')[0] + "-config-" + $sddcManagerFqdn.Split(".")[0] + ".htm"
$reportData = "<h1>SDDC Manager: $sddcManagerFqdn</h1>"
$workflowMessage = "VMware Cloud Foundation instance ($sddcManagerFqdn)"
$commandSwitch = "-allDomains"
Expand Down Expand Up @@ -742,7 +742,7 @@ Function Invoke-VcfUpgradePrecheck {
if (Test-VCFAuthentication -server $sddcManagerFqdn -user $sddcManagerUser -pass $sddcManagerPass) {
$defaultReport = Start-CreateReportDirectory -path $reportPath -reportType upgrade # Setup Report Location and Report File
if (!(Test-Path -Path $reportPath)) {Write-Warning "Unable to locate report path $reportPath, enter a valid path and try again"; Write-Host ""; Break }
$reportname = $defaultReport.Split('.')[0] + "-" + $workloadDomain + ".htm"
$reportname = $defaultReport.Split('-upgrade')[0] + "-upgrade-" + $workloadDomain + ".htm"
$workflowMessage = "Workload Domain ($workloadDomain)"
Start-SetupLogFile -Path $reportPath -ScriptName $MyInvocation.MyCommand.Name # Setup Log Location and Log File
Write-LogMessage -Type INFO -Message "Starting the Process of Running an Upgrade Precheck for $workflowMessage." -Colour Yellow
Expand Down Expand Up @@ -883,7 +883,7 @@ Function Invoke-VcfOverviewReport {
if (Test-VCFAuthentication -server $sddcManagerFqdn -user $sddcManagerUser -pass $sddcManagerPass) {
$defaultReport = Start-CreateReportDirectory -path $reportPath -reportType overview # Setup Report Location and Report File
if (!(Test-Path -Path $reportPath)) {Write-Warning "Unable to locate report path $reportPath, enter a valid path and try again"; Write-Host ""; Break }
$reportname = $defaultReport.Split('.')[0] + "-" + $sddcManagerFqdn.Split(".")[0] + ".htm"
$reportname = $defaultReport.Split('-overview')[0] + "-overview-" + $sddcManagerFqdn.Split(".")[0] + ".htm"
$workflowMessage = "VMware Cloud Foundation instance ($sddcManagerFqdn)"
Start-SetupLogFile -Path $reportPath -ScriptName $MyInvocation.MyCommand.Name # Setup Log Location and Log File
Write-LogMessage -Type INFO -Message "Starting the Process of Creating a System Overview Report for $workflowMessage." -Colour Yellow
Expand Down

0 comments on commit 61bdbce

Please sign in to comment.