Skip to content

Commit c685164

Browse files
committed
v1.3.5 release
## 1.3.5 - 2025-02-27 ### Fixed - Fix vSAN Capacity Overview reporting - Fix issue with license reporting ([Fix #128](#128)) - Fix issue with vCenter user privileges not handling groups (@nathcoad) ([Fix #102](#102)) - Fix time & date outputs showing incorrect date format - Fix VMware Update Manager reporting with PowerShell 7 ### Added - Add Free resource capacity reporting to VMhost hardware section ### Changed - Update VMware PowerCLI requirements to version 13.3 - Improve error reporting for vSAN section - Improve data size reporting. Data sizes are now displayed in more appropriately sized data units. - Change list tables to 40/60 column widths - Change datastore capacity reporting to include percentage used & free values - Update GitHub release workflow to add post to Bluesky social platform
1 parent b6377e2 commit c685164

File tree

8 files changed

+985
-748
lines changed

8 files changed

+985
-748
lines changed

.github/workflows/Release.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
needs: publish-to-gallery
3030
runs-on: ubuntu-latest
3131
steps:
32-
- uses: Eomm/why-don-t-you-tweet@v1
32+
- uses: Eomm/why-don-t-you-tweet@v2
3333
# We don't want to tweet if the repository is not a public one
3434
if: ${{ !github.event.repository.private }}
3535
with:
@@ -41,3 +41,13 @@ jobs:
4141
TWITTER_CONSUMER_API_SECRET: ${{ secrets.TWITTER_CONSUMER_API_SECRET }}
4242
TWITTER_ACCESS_TOKEN: ${{ secrets.TWITTER_ACCESS_TOKEN }}
4343
TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}
44+
bsky-post:
45+
needs: publish-to-gallery
46+
runs-on: ubuntu-latest
47+
steps:
48+
- uses: zentered/[email protected]
49+
with:
50+
post: "[New Release] ${{ github.event.repository.name }} ${{ github.event.release.tag_name }}! Check out what's new! ${{ github.event.release.html_url }} #VMware #vSphere #AsBuiltReport #vExpert"
51+
env:
52+
BSKY_IDENTIFIER: ${{ secrets.BSKY_IDENTIFIER }}
53+
BSKY_PASSWORD: ${{ secrets.BSKY_PASSWORD }}

AsBuiltReport.VMware.vSphere.psd1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
RootModule = 'AsBuiltReport.VMware.vSphere.psm1'
1313

1414
# Version number of this module.
15-
ModuleVersion = '1.3.4.1'
15+
ModuleVersion = '1.3.5'
1616

1717
# Supported PSEditions
1818
# CompatiblePSEditions = 'Desktop'
@@ -27,7 +27,7 @@
2727
# CompanyName = ''
2828

2929
# Copyright statement for this module
30-
Copyright = '(c) 2024 Tim Carman. All rights reserved.'
30+
Copyright = '(c) 2025 Tim Carman. All rights reserved.'
3131

3232
# Description of the functionality provided by this module
3333
Description = 'A PowerShell module to generate an as built report on the configuration of VMware vSphere.'
@@ -51,7 +51,7 @@
5151
RequiredModules = @(
5252
@{
5353
ModuleName = 'AsBuiltReport.Core';
54-
ModuleVersion = '1.3.0'
54+
ModuleVersion = '1.4.2'
5555
}
5656
)
5757

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,25 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## 1.3.5 - 2025-02-27
9+
### Fixed
10+
- Fix vSAN Capacity Overview reporting
11+
- Fix issue with license reporting ([Fix #128](https://github.com/AsBuiltReport/AsBuiltReport.VMware.vSphere/issues/128))
12+
- Fix issue with vCenter user privileges not handling groups (@nathcoad) ([Fix #102](https://github.com/AsBuiltReport/AsBuiltReport.VMware.vSphere/issues/102))
13+
- Fix time & date outputs showing incorrect date format
14+
- Fix VMware Update Manager reporting with PowerShell 7
15+
16+
### Added
17+
- Add Free resource capacity reporting to VMhost hardware section
18+
19+
### Changed
20+
- Update VMware PowerCLI requirements to version 13.3
21+
- Improve error reporting for vSAN section
22+
- Improve data size reporting. Data sizes are now displayed in more appropriately sized data units.
23+
- Change list tables to 40/60 column widths
24+
- Change datastore capacity reporting to include percentage used & free values
25+
- Update GitHub release workflow to add post to Bluesky social platform
26+
827
## 1.3.4.1 - 2024-03-28
928

1029
### Fixed

README.md

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,6 @@ Sample vSphere As Built report with health checks, using default report style.
4545

4646
![Sample vSphere Report 1](https://github.com/AsBuiltReport/AsBuiltReport.VMware.vSphere/blob/master/Samples/Sample_vSphere_Report_1.png "Sample vSphere Report 1")
4747

48-
### Sample Report 2 - Custom Style
49-
Sample vSphere As Built report with health checks, using custom report style.
50-
51-
![Sample vSphere Report 2](https://github.com/AsBuiltReport/AsBuiltReport.VMware.vSphere/blob/master/Samples/Sample_vSphere_Report_2.png "Sample vSphere Report 2")
52-
5348
# :beginner: Getting Started
5449
Below are the instructions on how to install, configure and generate a VMware vSphere As Built report.
5550

@@ -84,14 +79,6 @@ Each of these modules can be easily downloaded and installed via the PowerShell
8479
- [VMware PowerCLI Module](https://www.powershellgallery.com/packages/VMware.PowerCLI/)
8580
- [AsBuiltReport.VMware.vSphere Module](https://www.powershellgallery.com/packages/AsBuiltReport.VMware.vSphere/)
8681

87-
### Linux & macOS
88-
* .NET Core is required for cover page image support on Linux and macOS operating systems.
89-
* [Installing .NET Core for macOS](https://docs.microsoft.com/en-us/dotnet/core/install/macos)
90-
* [Installing .NET Core for Linux](https://docs.microsoft.com/en-us/dotnet/core/install/linux)
91-
92-
❗ If you are unable to install .NET Core, you must set `ShowCoverPageImage` to `False` in the report JSON configuration file.
93-
94-
9582
### :closed_lock_with_key: Required Privileges
9683

9784
A VMware vSphere As Built Report can be generated with read-only privileges, however the following sections will be skipped;
@@ -112,10 +99,10 @@ For a complete report, the following role assigned privileges are required;
11299

113100
Open a PowerShell terminal window and install each of the required modules.
114101

115-
:warning: VMware PowerCLI 12.3 or higher is required. Please ensure older PowerCLI versions have been uninstalled.
102+
:warning: VMware PowerCLI 13.3 or higher is required. Please ensure older PowerCLI versions have been uninstalled.
116103

117104
```powershell
118-
install-module VMware.PowerCLI -MinimumVersion 12.3 -AllowClobber
105+
install-module VMware.PowerCLI -MinimumVersion 13.3 -AllowClobber
119106
install-module AsBuiltReport.VMware.vSphere
120107
```
121108

Src/Private/Convert-DataSize.ps1

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
function Convert-DataSize {
2+
param (
3+
[double]$Size,
4+
[ValidateSet("KB", "MB", "GB", "TB", "PB")]
5+
[string]$InputUnit = "GB",
6+
[ValidateSet("KB", "MB", "GB", "TB", "PB")]
7+
[string]$OutputUnit,
8+
[int]$RoundUnits = 2
9+
)
10+
11+
switch ($InputUnit) {
12+
"KB" { $SizeInBytes = $Size * 1024 }
13+
"MB" { $SizeInBytes = $Size * 1024 * 1024 }
14+
"GB" { $SizeInBytes = $Size * 1024 * 1024 * 1024 }
15+
"TB" { $SizeInBytes = $Size * 1024 * 1024 * 1024 * 1024 }
16+
"PB" { $SizeInBytes = $Size * 1024 * 1024 * 1024 * 1024 * 1024 }
17+
}
18+
19+
if (-not $OutputUnit) {
20+
if ($SizeInBytes -ge [math]::Pow(1024, 5)) {
21+
$OutputUnit = "PB"
22+
} elseif ($SizeInBytes -ge [math]::Pow(1024, 4)) {
23+
$OutputUnit = "TB"
24+
} elseif ($SizeInBytes -ge [math]::Pow(1024, 3)) {
25+
$OutputUnit = "GB"
26+
} elseif ($SizeInBytes -ge [math]::Pow(1024, 2)) {
27+
$OutputUnit = "MB"
28+
} elseif ($SizeInBytes -ge [math]::Pow(1024, 1)) {
29+
$OutputUnit = "KB"
30+
} else {
31+
$OutputUnit = "GB"
32+
}
33+
}
34+
35+
switch ($OutputUnit) {
36+
"KB" { $OutputSize = $SizeInBytes / 1024 }
37+
"MB" { $OutputSize = $SizeInBytes / (1024 * 1024) }
38+
"GB" { $OutputSize = $SizeInBytes / (1024 * 1024 * 1024) }
39+
"TB" { $OutputSize = $SizeInBytes / (1024 * 1024 * 1024 * 1024) }
40+
"PB" { $OutputSize = $SizeInBytes / (1024 * 1024 * 1024 * 1024 * 1024) }
41+
}
42+
43+
return "{0:N$RoundUnits} $OutputUnit" -f $OutputSize
44+
}

Src/Private/Get-License.ps1

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ function Get-License {
55
.DESCRIPTION
66
Function to retrieve vSphere product licensing information.
77
.NOTES
8-
Version: 0.2.0
8+
Version: 0.3.0
99
Author: Tim Carman
1010
Twitter: @tpcarman
1111
Github: tpcarman
@@ -32,32 +32,35 @@ function Get-License {
3232
(
3333
[Parameter(Mandatory = $false, ValueFromPipeline = $false)]
3434
[ValidateNotNullOrEmpty()]
35-
[PSObject]$vCenter,
35+
[PSObject]$vCenter,
3636
[PSObject]$VMHost,
3737
[Parameter(Mandatory = $false, ValueFromPipeline = $false)]
3838
[Switch]$Licenses
39-
)
39+
)
4040

4141
$LicenseObject = @()
4242
$ServiceInstance = Get-View ServiceInstance -Server $vCenter
4343
$LicenseManager = Get-View $ServiceInstance.Content.LicenseManager -Server $vCenter
4444
$LicenseManagerAssign = Get-View $LicenseManager.LicenseAssignmentManager -Server $vCenter
4545
if ($VMHost) {
4646
$VMHostId = $VMHost.Extensiondata.Config.Host.Value
47-
$VMHostAssignedLicense = $LicenseManagerAssign.QueryAssignedLicenses($VMHostId)
47+
$VMHostAssignedLicense = $LicenseManagerAssign.QueryAssignedLicenses($VMHostId)
4848
$VMHostLicense = $VMHostAssignedLicense.AssignedLicense
4949
$VMHostLicenseExpiration = ($VMHostLicense.Properties | Where-Object { $_.Key -eq 'expirationDate' } | Select-Object Value).Value
5050
if ($VMHostLicense.LicenseKey -and $Options.ShowLicenseKeys) {
5151
$VMHostLicenseKey = $VMHostLicense.LicenseKey
5252
} else {
53-
$VMHostLicenseKey = "*****-*****-*****" + $VMHostLicense.LicenseKey.Substring(17)
53+
$keyParts = $VMHostLicense.LicenseKey -split '-'
54+
$lastPart = $keyParts[-1]
55+
$maskedParts = $keyParts[0..($keyParts.Length - 2)] | ForEach-Object { '*' * $_.Length }
56+
$VMHostLicenseKey = ($maskedParts -join '-') + '-' + $lastPart
5457
}
55-
$LicenseObject = [PSCustomObject]@{
56-
Product = $VMHostLicense.Name
58+
$LicenseObject = [PSCustomObject]@{
59+
Product = $VMHostLicense.Name
5760
LicenseKey = $VMHostLicenseKey
5861
Expiration =
5962
if ($VMHostLicenseExpiration -eq $null) {
60-
"Never"
63+
"Never"
6164
} elseif ($VMHostLicenseExpiration -gt (Get-Date)) {
6265
$VMHostLicenseExpiration.ToShortDateString()
6366
} else {
@@ -69,17 +72,20 @@ function Get-License {
6972
$vCenterAssignedLicense = $LicenseManagerAssign.GetType().GetMethod("QueryAssignedLicenses").Invoke($LicenseManagerAssign, @($_.MoRef.Value)) | Where-Object { $_.EntityID -eq $vCenter.InstanceUuid }
7073
$vCenterLicense = $vCenterAssignedLicense.AssignedLicense
7174
$vCenterLicenseExpiration = ($vCenterLicense.Properties | Where-Object { $_.Key -eq 'expirationDate' } | Select-Object Value).Value
72-
if ($vCenterLicense.LicenseKey -and $Options.ShowLicenseKeys) {
75+
if ($vCenterLicense.LicenseKey -and $Options.ShowLicenseKeys) {
7376
$vCenterLicenseKey = $vCenterLicense.LicenseKey
7477
} else {
75-
$vCenterLicenseKey = "*****-*****-*****" + $vCenterLicense.LicenseKey.Substring(17)
78+
$keyParts = $vCenterLicense.LicenseKey -split '-'
79+
$lastPart = $keyParts[-1]
80+
$maskedParts = $keyParts[0..($keyParts.Length - 2)] | ForEach-Object { '*' * $_.Length }
81+
$vCenterLicenseKey = ($maskedParts -join '-') + '-' + $lastPart
7682
}
77-
$LicenseObject = [PSCustomObject]@{
83+
$LicenseObject = [PSCustomObject]@{
7884
Product = $vCenterLicense.Name
7985
LicenseKey = $vCenterLicenseKey
8086
Expiration =
8187
if ($vCenterLicenseExpiration -eq $null) {
82-
"Never"
88+
"Never"
8389
} elseif ($vCenterLicenseExpiration -gt (Get-Date)) {
8490
$vCenterLicenseExpiration.ToShortDateString()
8591
} else {
@@ -94,18 +100,21 @@ function Get-License {
94100
if ($Options.ShowLicenseKeys) {
95101
$LicenseKey = $License.LicenseKey
96102
} else {
97-
$LicenseKey = "*****-*****-*****" + $License.LicenseKey.Substring(17)
103+
$keyParts = $License.LicenseKey -split '-'
104+
$lastPart = $keyParts[-1]
105+
$maskedParts = $keyParts[0..($keyParts.Length - 2)] | ForEach-Object { '*' * $_.Length }
106+
$LicenseKey = ($maskedParts -join '-') + '-' + $lastPart
98107
}
99108
$Object = [PSCustomObject]@{
100-
'License' = $License.License
109+
'License' = $License.License
101110
'Product' = $License.Name
102111
'LicenseKey' = $LicenseKey
103112
'Total' = $License.Total
104113
'Used' = Switch ($License.Used) {
105114
$null { "0" }
106115
default { $License.Used }
107116
}
108-
'Expiration' =
117+
'Expiration' =
109118
if ($LicenseExpiration -eq $null) {
110119
"Never"
111120
} elseif ($LicenseExpiration -gt (Get-Date)) {

Src/Private/Get-RequiredModule.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ function Get-RequiredModule {
2525
# Check if the required version of VMware PowerCLI is installed
2626
$RequiredModule = Get-Module -ListAvailable -Name $Name | Sort-Object -Property Version -Descending | Select-Object -First 1
2727
$ModuleVersion = "$($RequiredModule.Version.Major)" + "." + "$($RequiredModule.Version.Minor)"
28+
Write-PScriboMessage -Plugin "Module" -IsWarning "$($RequiredModule.Name + " " + $ModuleVersion) is currently installed."
2829
if ($ModuleVersion -eq ".") {
2930
throw "VMware PowerCLI $Version or higher is required to run the VMware vSphere As Built Report. Run 'Install-Module -Name $Name -MinimumVersion $Version -Force' to install the required modules."
3031
}

0 commit comments

Comments
 (0)