From 61bdbce62e365ad100af20cca9f7ccb2ee51b0ad Mon Sep 17 00:00:00 2001 From: Gary Blake <31245616+GaryJBlake@users.noreply.github.com> Date: Wed, 22 May 2024 12:53:47 +0100 Subject: [PATCH] fix: report output failing (#217) Updated `Invoke-*Report` cmdlets to handle `.` or `-` in the report path. --- CHANGELOG.md | 14 +++- VMware.CloudFoundation.Reporting.psd1 | 106 +++++++++++++------------- VMware.CloudFoundation.Reporting.psm1 | 10 +-- 3 files changed, 71 insertions(+), 59 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c798f0ec..9a6c5645 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # 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 @@ -7,7 +19,7 @@ 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 diff --git a/VMware.CloudFoundation.Reporting.psd1 b/VMware.CloudFoundation.Reporting.psd1 index aaa979ee..3a3c7a02 100644 --- a/VMware.CloudFoundation.Reporting.psd1 +++ b/VMware.CloudFoundation.Reporting.psd1 @@ -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' @@ -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 = '' - + } diff --git a/VMware.CloudFoundation.Reporting.psm1 b/VMware.CloudFoundation.Reporting.psm1 index 643306cd..9efc5233 100644 --- a/VMware.CloudFoundation.Reporting.psm1 +++ b/VMware.CloudFoundation.Reporting.psm1 @@ -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 = "