Skip to content

Commit

Permalink
refactor: update Invoke-VcfReportingPrereq cmdlet
Browse files Browse the repository at this point in the history
- **Breaking**: Updates `Invoke-VcfReportingPrereq` to:
    - Use the `-sddcManagerFqdn`, `sddcManagerUser`, and `sddcManagerPass` parameters to check the SDDC Manager version.
    - Use the `Write-LogMessage` to apply colors to the output and log the output to a file using the `-logPath` parameter.
- Updates `PowerValidatedSolutions` from v2.0.1 to v2.2.0.
- Updates `VMware.PowerCLI` from v12.7.0 to v13.0.0.
- Updates `VMware.vSphere.SsoAdmin` from v1.3.8 to v1.3.9.

Closes #115

Signed-off-by: Ryan Johnson <johnsonryan@vmware.com>
  • Loading branch information
tenthirtyam committed Apr 11, 2023
1 parent 2ceb52a commit bc76a19
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 16 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,17 @@
> Release Date: Unreleased
Enhancement:

- Updates `Publish-CertificateHealth` with thresholds based on certificate expiration. [GH-107](https://github.com/vmware/powershell-module-for-vmware-cloud-foundation-reporting/pull/107)
- Updates `Publish-CertificateHealth` to include an "Expires In (Days)" column. [GH-107](https://github.com/vmware/powershell-module-for-vmware-cloud-foundation-reporting/pull/107)
- Updates `Publish-CertificateHealth` to include ESXi host certificates. [GH-107](https://github.com/vmware/powershell-module-for-vmware-cloud-foundation-reporting/pull/107)
- Updates `Publish-PasswordHealth` to include an "Expires In (Days)" column. [GH-111](https://github.com/vmware/powershell-module-for-vmware-cloud-foundation-reporting/pull/111)

Refactor:

- **Breaking**: Updates `Invoke-VcfReportingPrereq` to:
- Use the `-sddcManagerFqdn`, `sddcManagerUser`, and `sddcManagerPass` parameters to check the SDDC Manager version.
- Use the `Write-LogMessage` to apply colors to the output and log the output to a file using the `-logPath` parameter.
- **Breaking**: Updates `Invoke-VcfHealthReport` to use `-localUser` and `localPass` parameters instead of `-SddcManagerRootPass`. Examples use the local `vcf` user account for the SDDC Manager virtual appliance. [GH-113](https://github.com/vmware/powershell-module-for-vmware-cloud-foundation-reporting/pull/113)
- **Breaking**: Updates `Publish-StorageCapacityHealth` to use `-localUser` and `localPass` parameters instead of `-rootPass`. Examples use the local `vcf` user account for the SDDC Manager virtual appliance. [GH-113](https://github.com/vmware/powershell-module-for-vmware-cloud-foundation-reporting/pull/113)
- **Breaking**: Updates `Request-SddcManagerStorageHealth` to use `-localUser` and `localPass` parameters instead of `-rootPass`. Examples use the local `vcf` user account for the SDDC Manager virtual appliance. [GH-113](https://github.com/vmware/powershell-module-for-vmware-cloud-foundation-reporting/pull/113)
Expand All @@ -19,17 +24,25 @@ Refactor:
- Updates `Invoke-VcfHealthReport` to use the `Publish-PasswordHealth` cmdlet. [GH-111](https://github.com/vmware/powershell-module-for-vmware-cloud-foundation-reporting/pull/111)
- Removes `Publish-LocalUserExpiry` in favor of the `Publish-PasswordHealth` cmdlet. [GH-111](https://github.com/vmware/powershell-module-for-vmware-cloud-foundation-reporting/pull/111)

Chore:

- Updates `PowerValidatedSolutions` from v2.0.1 to v2.2.0.
- Updates `VMware.PowerCLI` from v12.7.0 to v13.0.0.
- Updates `VMware.vSphere.SsoAdmin` from v1.3.8 to v1.3.9.

## [v1.1.0](https://github.com/vmware/powershell-module-for-vmware-cloud-foundation-reporting/releases/tag/v1.1.0)

> Release Date: 2023-02-28
Bugfix:

- Updates `Request-VcenterBackupStatus` backup message to remove the SDDC Manager FQDN when backups are located on the SDDC Manager. Required for Heatlh Monitoring and Reporting solution alerts. [GH-95](https://github.com/vmware/powershell-module-for-vmware-cloud-foundation-reporting/pull/95)
- Updates `Publish-vCenerHealth` to correctly link and display the vCenter Server Ring Topology Health from SoS. [GH-94](https://github.com/vmware/powershell-module-for-vmware-cloud-foundation-reporting/pull/94)
- Resolves an issue with the display name of the vRealize Log Insight product name in the `Request-VrealizeOverview`due to an upstream error in the `.SYNOPSIS` of `Get-VCFvRLI` in `PowerVCF`. [GH-86](https://github.com/vmware/powershell-module-for-vmware-cloud-foundation-reporting/pull/86)
- Updates `Test-VcfReportingPrereq` to return results when run on Photon OS. [GH-82](https://github.com/vmware/powershell-module-for-vmware-cloud-foundation-reporting/pull/82)

Enhancement:

- Updates `Publish-*` cmdlets to support JSON generation. Required for Heatlh Monitoring and Reporting solution. [GH-79](https://github.com/vmware/powershell-module-for-vmware-cloud-foundation-reporting/pull/79)
- `Publish-BackupStatus`
- `Publish-NsxtTransportNodeStatus`
Expand All @@ -43,10 +56,12 @@ Enhancement:
- Adds an option to `Request-ESXiOverview` to report on the VCF+ subscription cores and export the results to CSV. [GH-87](https://github.com/vmware/powershell-module-for-vmware-cloud-foundation-reporting/pull/87)

Documenation:

- Updates `README.md` to remove the **Known Issues** section and adds references to the GitHub issue tracker for support. [GH-88](https://github.com/vmware/powershell-module-for-vmware-cloud-foundation-reporting/pull/88)
- Updates `README.md` documentation to include support for DellEMC VxRAIL. [GH-98](https://github.com/vmware/powershell-module-for-vmware-cloud-foundation-reporting/pull/98)

Chore:

- Removes the password policy functions that were moved to `PowerValidatedSolutions` v2.0.0. [GH-100](https://github.com/vmware/powershell-module-for-vmware-cloud-foundation-reporting/pull/100)
- Updates `PowerValidatedSolutions` from v2.0.0 to v2.0.1. [GH-99](https://github.com/vmware/powershell-module-for-vmware-cloud-foundation-reporting/pull/99)

Expand Down
4 changes: 2 additions & 2 deletions VMware.CloudFoundation.Reporting.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# Generated by: Gary Blake, Cloud Infrastructure Business Group (CIBG)
#
# Generated on: 03/28/2023
# Generated on: 04/25/2023
#

@{
Expand All @@ -12,7 +12,7 @@
RootModule = '.\VMware.CloudFoundation.Reporting.psm1'

# Version number of this module.
ModuleVersion = '2.0.0.1005'
ModuleVersion = '2.0.0.1006'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down
57 changes: 43 additions & 14 deletions VMware.CloudFoundation.Reporting.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -8072,28 +8072,57 @@ Function Test-VcfReportingPrereq {
The Test-VcfReportingPrereq cmdlet checks that all the prerequisites have been met to run the PowerShell module.

.EXAMPLE
Test-VcfReportingPrereq
Test-VcfReportingPrereq -sddcManagerFqdn sfo-vcf01.sfo.rainpole.io -sddcManagerUser admin@local -sddcManagerPass VMw@re1!VMw@re1! -logPath F:\Reporting
This example runs the prerequisite validation.
#>

Param (
[Parameter (Mandatory = $true)] [ValidateNotNullOrEmpty()] [String]$sddcManagerFqdn,
[Parameter (Mandatory = $true)] [ValidateNotNullOrEmpty()] [String]$sddcManagerUser,
[Parameter (Mandatory = $true)] [ValidateNotNullOrEmpty()] [String]$sddcManagerPass,
[Parameter (Mandatory = $true)] [ValidateNotNullOrEmpty()] [String]$logPath
)

Try {
Clear-Host; Write-Host ""

$vcfMinVersion = "4.4.0"

$modules = @(
@{ Name=("VMware.PowerCLI"); Version=("12.7.0")}
@{ Name=("VMware.vSphere.SsoAdmin"); Version=("1.3.8")}
@{ Name=("PowerVCF"); Version=("2.2.0")}
@{ Name=("PowerValidatedSolutions"); Version=("2.0.1")}
@{ Name=("VMware.PowerCLI"); MinimumVersion=("13.0.0")}
@{ Name=("VMware.vSphere.SsoAdmin"); MinimumVersion=("1.3.9")}
@{ Name=("PowerVCF"); MinimumVersion=("2.2.0")}
@{ Name=("PowerValidatedSolutions"); MinimumVersion=("2.2.0")}
)
foreach ($module in $modules ) {
if ((Get-InstalledModule -Name $module.Name).Version -lt $module.Version) {
$message = "PowerShell Module: $($module.Name) Version: $($module.Version) Not Installed, Please update before proceeding."
Write-Warning $message; Write-Host ""
break
} else {
$moduleCurrentVersion = (Get-InstalledModule -Name $module.Name).Version
$message = "PowerShell Module: $($module.Name) Version: $($moduleCurrentVersion) Found, Supports the minimum required version."
$message

if (Test-VCFConnection -server $sddcManagerFqdn) {
if (Test-VCFAuthentication -server $sddcManagerFqdn -user $sddcManagerUser -pass $sddcManagerPass) {
Start-SetupLogFile -Path $logPath -ScriptName $MyInvocation.MyCommand.Name # Setup Log Location and Log File

$vcfVersion = ((Get-VCFManager).version).Split('-')[0]
if ($vcfVersion -lt $vcfMinVersion) {
$message = "VMware Cloud Foundation: SDDC Manager $vcfVersion ($($sddcManagerFqdn)) is not supported by this module. Minimum required version is $($vcfMinVersion)."
Write-LogMessage -Type ERROR -Message $message -Colour Red
Break
} else {
$message = "VMware Cloud Foundation: SDDC Manager $vcfVersion ($($sddcManagerFqdn)) and supports the minimum required version."
Write-LogMessage -Type INFO -Message $message -Colour Green
}

foreach ($module in $modules ) {
if ((Get-InstalledModule -ErrorAction SilentlyContinue -Name $module.Name).Version -lt $module.MinimumVersion) {
$message = "PowerShell Module: $($module.Name) $($module.MinimumVersion) is not installed."
Write-LogMessage -Type ERROR -Message $message -Colour Red
Break
} else {
$moduleCurrentVersion = (Get-InstalledModule -Name $module.Name).Version
$message = "PowerShell Module: $($module.Name) $($moduleCurrentVersion) is installed and supports the minimum required version."
Write-LogMessage -Type INFO -Message $message -Colour Green
}
}
}
}

}
Catch {
Write-Error $_.Exception.Message
Expand Down

0 comments on commit bc76a19

Please sign in to comment.