Skip to content

Commit

Permalink
Fix for no install date value
Browse files Browse the repository at this point in the history
  • Loading branch information
rebelinux committed Feb 17, 2024
1 parent 97720f6 commit 7df770f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Src/Private/Get-AbrWinOSHotfix.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ function Get-AbrWinOSHotfix {
$TempHotFix = [PSCustomObject] @{
'Hotfix ID' = $HotFix.HotFixID
'Description' = $HotFix.Description
'Installation Date' = $HotFix.InstalledOn.ToShortDateString()
'Installation Date' = Switch ([string]::IsNullOrEmpty($HotFix.InstalledOn)) {
$true {'--'}
$false {$HotFix.InstalledOn.ToShortDateString()}
default {'Unknown'}
}
}
$HotfixReport += $TempHotFix
} catch {
Expand Down

0 comments on commit 7df770f

Please sign in to comment.