From b6494594a55513f81549b2d52487c36955efad15 Mon Sep 17 00:00:00 2001 From: Ryan Johnson Date: Sun, 5 Feb 2023 11:21:39 -0500 Subject: [PATCH] fix: vrealize product display name Resolves an issue with the display name of the vRealize Log Insight product name in the **vRealize Suite Overview** due to an upstream error in the `.SYNOPSIS` of `Get-VCFvRLI` in `PowerVCF`. This change may allow future versions of the module to adopt the rebranding to Aria Suite ahead of PowerVCF. Signed-off-by: Ryan Johnson --- VMware.CloudFoundation.Reporting.psm1 | 37 +++++++++++++++++++-------- 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/VMware.CloudFoundation.Reporting.psm1 b/VMware.CloudFoundation.Reporting.psm1 index 220cbc0a..6da57e53 100644 --- a/VMware.CloudFoundation.Reporting.psm1 +++ b/VMware.CloudFoundation.Reporting.psm1 @@ -8733,21 +8733,38 @@ Function Request-VrealizeOverview { $vcfApiCmdlet = @("Get-VCFvRSLCM","Get-VCFWSA","Get-VCFvRLI","Get-VCFvROPS","Get-VCFvRA") foreach ($apiCmdlet in $vcfApiCmdlet) { if ((Invoke-Expression $apiCmdlet).status -eq "ACTIVE") { - if ($apiCmdlet -eq "Get-VCFvRSLCM") {$nodeCount = "1" } else { ($nodeCount = ((Invoke-Expression $apiCmdlet).nodes).Count)} + if ($apiCmdlet -eq "Get-VCFvRSLCM") {$nodeCount = "1"} else { ($nodeCount = ((Invoke-Expression $apiCmdlet).nodes).Count)} + + if ($apiCmdlet -eq "Get-VCFvRSLCM") { + $product = "vRealize Suite Lifecycle Manager" + } + elseif ($apiCmdlet -eq "Get-VCFWSA") { + $product = "Workspace ONE Access" + } + elseif ($apiCmdlet -eq "Get-VCFvRLI") { + $product = "vRealize Log Insight" + } + elseif ($apiCmdlet -eq "Get-VCFvROPS") { + $product = "vRealize Operations" + } + elseif ($apiCmdlet -eq "Get-VCFvRA") { + $product = "vRealize Automation" + } + $customObject = New-Object -TypeName psobject - $customObject | Add-Member -notepropertyname "vRealize Product" -notepropertyvalue ((Get-Help -Name $apiCmdlet).synopsis -Split ("Get the existing ") | Select-Object -Last 1) - if ($PsBoundParameters.ContainsKey('anonymized')) { - $customObject | Add-Member -notepropertyname "UUID" -notepropertyvalue (Invoke-Expression $apiCmdlet).id + $customObject | Add-Member -NotePropertyName "vRealize Product" -NotePropertyValue $product + if ($PsBoundParameters.ContainsKey("anonymized")) { + $customObject | Add-Member -NotePropertyName "UUID" -NotePropertyValue (Invoke-Expression $apiCmdlet).id } else { if ($apiCmdlet -eq "Get-VCFvRSLCM") { - $customObject | Add-Member -notepropertyname "FQDN" -notepropertyvalue (Invoke-Expression $apiCmdlet).fqdn + $customObject | Add-Member -NotePropertyName "FQDN" -NotePropertyValue (Invoke-Expression $apiCmdlet).fqdn } else { - $customObject | Add-Member -notepropertyname "FQDN" -notepropertyvalue (Invoke-Expression $apiCmdlet).loadBalancerFqdn + $customObject | Add-Member -NotePropertyName "FQDN" -NotePropertyValue (Invoke-Expression $apiCmdlet).loadBalancerFqdn } } - $customObject | Add-Member -notepropertyname "Version" -notepropertyvalue (Invoke-Expression $apiCmdlet).version - $customObject | Add-Member -notepropertyname "Status" -notepropertyvalue (Invoke-Expression $apiCmdlet).status - $customObject | Add-Member -notepropertyname "Nodes" -notepropertyvalue $nodeCount + $customObject | Add-Member -NotePropertyName "Version" -NotePropertyValue (Invoke-Expression $apiCmdlet).version + $customObject | Add-Member -NotePropertyName "Status" -NotePropertyValue (Invoke-Expression $apiCmdlet).status + $customObject | Add-Member -NotePropertyName "Nodes" -NotePropertyValue $nodeCount $allVrealizeObject += $customObject } } @@ -8755,7 +8772,7 @@ Function Request-VrealizeOverview { } } } - Catch { + Catch { Debug-ExceptionWriter -object $_ } }