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

feat: add check for cmdlet prerequisites #191

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Release History

## v2.5.0

> Release Date: Unreleased
Enhancement:

- Added a prerequisite check to `Invoke-VcfHealthReport` function to verify that the tar utility is present on Windows if using Windows PowerShell 5.1 (Desktop) or PowerShell 7 (Core). The `tar` utility is included with Windows Server 2019 and later and is noted as a system requirement in the documentation. [GH-191](https://github.com/vmware/powershell-module-for-vmware-cloud-foundation-reporting/pull/191)

## v2.4.2

> Release Date: 2023-10-18
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: VMware, Inc.
#
# Generated on: 2023-10-18
# Generated on: 2023-11-16
#

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

# Version number of this module.
ModuleVersion = '2.4.2.1000'
ModuleVersion = '2.5.0.1000'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down
8 changes: 8 additions & 0 deletions VMware.CloudFoundation.Reporting.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,14 @@ Function Invoke-VcfHealthReport {

Try {
Clear-Host; Write-Host ""

if ($PSVersionTable.PSEdition -eq "Desktop" -or $PSVersionTable.OS -like "Microsoft Windows*") {
$tarPath = (Get-Command tar -ErrorAction SilentlyContinue).Source
if (!($tarPath)) {
Write-Warning "The tar utility is required to run this cmdlet. Please check the module system requirements and try again."
return
}
}

if (Test-VCFConnection -server $sddcManagerFqdn) {
if (Test-VCFAuthentication -server $sddcManagerFqdn -user $sddcManagerUser -pass $sddcManagerPass) {
Expand Down