Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update Test-VcfReportingPrereq #82

Merged
merged 1 commit into from
Jan 31, 2023

Conversation

bhumitra
Copy link
Contributor

@bhumitra bhumitra commented Jan 28, 2023

Signed-off-by: bhumitra nagar [email protected]

In order to have a good experience with our community, we recommend that you read the contributing guidelines for making a pull request.

Summary of Pull Request
Test-VcfReportingPrereq doesnt return any output on Photon OS
There were following issues with the code logic -

  • Get-Module should be changed to Get-InstalledModule.
  • The if (!$module -eq "VMware.PowerCLI") condition for checking PowerCli module is not correct.
  • Also, upon checking we don't need to have separate conditions for Windows and other OS. Same code works on both powershell core and desktop versions.

Here is the output after the fix
on Windows -

PS C:\> Test-VcfReportingPrereq
PowerShell Module: VMware.PowerCLI Version: 12.7.0.20091289 Found, Supports the minimum required version.
PowerShell Module: VMware.vSphere.SsoAdmin Version: 1.3.8 Found, Supports the minimum required version.
PowerShell Module: PowerVCF Version: 2.2.0 Found, Supports the minimum required version.
WARNING: PowerShell Module: PowerValidatedSolutions Version: 2.0.0 Not Installed, Please update before proceeding.

PS C:\>

On Photon OS

PS /root/.local/share/powershell/Modules/VMware.CloudFoundation.Reporting/1.0.5.1002> Test-VcfReportingPrereq
PowerShell Module: VMware.PowerCLI Version: 13.0.0.20829139 Found, Supports the minimum required version.
PowerShell Module: VMware.vSphere.SsoAdmin Version: 1.3.8 Found, Supports the minimum required version.
PowerShell Module: PowerVCF Version: 2.2.0 Found, Supports the minimum required version.
WARNING: PowerShell Module: PowerValidatedSolutions Version: 2.0.0 Not Installed, Please update before proceeding.

Type of Pull Request

  • This is a bug fix.
  • This is an enhancement or feature.
  • This is a code style / formatting update.
  • This is a documentation update.
  • This is a refactoring update.
  • This is a chore update
  • This is something else.
    Please describe:

Related to Existing Issues

Closes #81

Test and Documentation Coverage

  • Tests have been completed (for bug fixes / features).
  • Documentation has been added / updated (for bug fixes / features).

Breaking Changes?

  • Yes, there are breaking changes.
  • No, there are no breaking changes.

@bhumitra bhumitra requested a review from a team as a code owner January 28, 2023 23:03
@github-actions github-actions bot added the needs-review Needs Review label Jan 28, 2023
@tenthirtyam tenthirtyam added this to the v1.1.0 milestone Jan 29, 2023
@tenthirtyam tenthirtyam added bug Bug size/s Relative Sizing: small labels Jan 30, 2023
@tenthirtyam tenthirtyam changed the title Fix Test-VcfReportingPrereq cmdlet fix: update Test-VcfReportingPrereq Jan 30, 2023
@tenthirtyam
Copy link
Collaborator

tenthirtyam commented Jan 31, 2023

Update: I will review it soon now that v1.0.6 is now released.

Copy link
Collaborator

@tenthirtyam tenthirtyam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Photon OS

PS /home/vmware/code/VMware.CloudFoundation.Reporting> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.2.7
PSEdition                      Core
GitCommitId                    7.2.7
OS                             Linux 5.10.109-2.ph4-esx #1-photon SMP Sat May 14 02:59:09 UTC 2022
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

PS /home/vmware/code> cd ./VMware.CloudFoundation.Reporting/
PS /home/vmware/code/VMware.CloudFoundation.Reporting> Import-Module ./VMware.CloudFoundation.Reporting.psd1
PS /home/vmware/code/VMware.CloudFoundation.Reporting> Test-VcfReportingPrereq
WARNING: PowerShell Module: VMware.PowerCLI Version: 12.7.0 Not Installed, Please update before proceeding.

PS /home/vmware/code/VMware.CloudFoundation.Reporting> Update-Module -Name VMware.PowerCLI

Untrusted repository
You are installing the modules from an untrusted repository. If you trust this repository, change its InstallationPolicy value by running the
Set-PSRepository cmdlet. Are you sure you want to install the modules from 'PSGallery'?
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "N"): A
PS /home/vmware/code/VMware.CloudFoundation.Reporting> Get-InstalledModule VMware.PowerCLI

Version              Name                                Repository           Description
-------              ----                                ----------           -----------
13.0.0.20829139      VMware.PowerCLI                     PSGallery            This Windows PowerShell module contains VMware.PowerCLI

PS /home/vmware/code/VMware.CloudFoundation.Reporting> Test-VcfReportingPrereq
PowerShell Module: VMware.PowerCLI Version: 13.0.0.20829139 Found, Supports the minimum required version.
PowerShell Module: VMware.vSphere.SsoAdmin Version: 1.3.8 Found, Supports the minimum required version.
PowerShell Module: PowerVCF Version: 2.2.0 Found, Supports the minimum required version.
PowerShell Module: PowerValidatedSolutions Version: 2.0.0.1010 Found, Supports the minimum required version.
PS /home/vmware/code/VMware.CloudFoundation.Reporting>

Windows Server 2022 with Windows PowerShell 5.1

PS F:\VMware.CloudFoundation.Reporting> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.14393.5127
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.14393.5127
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

PS F:\VMware.CloudFoundation.Reporting> Import-Module .\VMware.CloudFoundation.Reporting.psd1
PS F:\VMware.CloudFoundation.Reporting> Test-VcfReportingPrereq
PowerShell Module: VMware.PowerCLI Version: 12.7.0.20091289 Found, Supports the minimum required version.
PowerShell Module: VMware.vSphere.SsoAdmin Version: 1.3.8 Found, Supports the minimum required version.
PowerShell Module: PowerVCF Version: 2.2.0 Found, Supports the minimum required version.
WARNING: PowerShell Module: PowerValidatedSolutions Version: 2.0.0 Not Installed, Please update before proceeding.

PS F:\VMware.CloudFoundation.Reporting> Update-Module -Name PowerValidatedSolutions
PS F:\VMware.CloudFoundation.Reporting> Test-VcfReportingPrereq
PowerShell Module: VMware.PowerCLI Version: 12.7.0.20091289 Found, Supports the minimum required version.
PowerShell Module: VMware.vSphere.SsoAdmin Version: 1.3.8 Found, Supports the minimum required version.
PowerShell Module: PowerVCF Version: 2.2.0 Found, Supports the minimum required version.
PowerShell Module: PowerValidatedSolutions Version: 2.0.0.1010 Found, Supports the minimum required version.
PS F:\VMware.CloudFoundation.Reporting>

@tenthirtyam tenthirtyam merged commit 41cc83c into vmware:main Jan 31, 2023
@tenthirtyam tenthirtyam removed the needs-review Needs Review label Jan 31, 2023
@github-actions
Copy link

github-actions bot commented Mar 3, 2023

I'm going to lock this pull request because it has been closed for 30 days. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 3, 2023
@bhumitra bhumitra deleted the fix-issue-81 branch March 17, 2023 19:22
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Bug size/s Relative Sizing: small
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Test-VcfReportingPrereq doesnt return any output on Photon OS
2 participants