mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-21 15:19:58 -05:00
27 lines
No EOL
731 B
PowerShell
27 lines
No EOL
731 B
PowerShell
param($Config = $null);
|
|
|
|
[hashtable]$HotfixInfo = @{};
|
|
[hashtable]$HotfixNameCache = @{};
|
|
|
|
# First fetch all of our hotfixes
|
|
$Hotfixes = Get-Hotfix;
|
|
|
|
foreach ($property in $Hotfixes) {
|
|
[hashtable]$HotfixData = @{};
|
|
foreach ($hotfix in $property.Properties) {
|
|
$HotfixData.Add($hotfix.Name, $hotfix.Value);
|
|
}
|
|
|
|
[string]$name = [string]::Format('{0} [{1}]', $HotfixData.HotFixID, $HotfixData.InstalledOn);
|
|
|
|
if ($HotfixNameCache.ContainsKey($name) -eq $FALSE) {
|
|
$HotfixNameCache.Add($name, 1);
|
|
} else {
|
|
$HotfixNameCache[$name] += 1;
|
|
$name = [string]::Format('{0} ({1})', $name, $HotfixNameCache[$name]);
|
|
}
|
|
|
|
$HotfixInfo.Add($name, $HotfixData);
|
|
}
|
|
|
|
return $HotfixInfo; |