From 5ab468b8e23e371eb8dc446aeac9187e3e8dc9e2 Mon Sep 17 00:00:00 2001 From: Jonathan Colon Date: Thu, 21 Mar 2024 09:44:49 -0400 Subject: [PATCH] Fix #25 --- CHANGELOG.md | 4 +++- Src/Private/Get-AbrWinApplication.ps1 | 13 +++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fc1d129..2b52217 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [0.5.4] - Unreleased -### Added +### Fixed + +- Fix #25 ## [0.5.3] - 2024-03-06 diff --git a/Src/Private/Get-AbrWinApplication.ps1 b/Src/Private/Get-AbrWinApplication.ps1 index 9f57723..ff8f65a 100644 --- a/Src/Private/Get-AbrWinApplication.ps1 +++ b/Src/Private/Get-AbrWinApplication.ps1 @@ -5,7 +5,7 @@ function Get-AbrWinApplication { .DESCRIPTION Documents the configuration of Microsoft Windows Server in Word/HTML/Text formats using PScribo. .NOTES - Version: 0.5.2 + Version: 0.5.4 Author: Andrew Ramsay Editor: Jonathan Colon Twitter: @asbuiltreport @@ -40,14 +40,15 @@ function Get-AbrWinApplication { $TempAddRemoveReport = [PSCustomObject]@{ 'Application Name' = $App.DisplayName 'Publisher' = $App.Publisher - 'Version' = Switch ([string]::IsNullOrEmpty($App.Version)) { + 'Version' = Switch ([string]::IsNullOrEmpty($App.DisplayVersion)) { $true { "--" } - $false { $App.Version } + $false { $App.DisplayVersion } default { "Unknown" } } - 'Install Date' = Switch (($App.InstallDate).count) { - 0 { "--" } - default { $App.InstallDate } + 'Install Date' = Switch ([string]::IsNullOrEmpty($App.InstallDate)) { + $true { "--" } + $false {$App.InstallDate} + default { 'Unknown' } } } $AddRemoveReport += $TempAddRemoveReport