mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-20 23:00:35 -05:00
Improved organising for Pending Updates provider
This commit is contained in:
parent
7bde4fad0b
commit
1b08267f6f
1 changed files with 2 additions and 1 deletions
|
|
@ -11,6 +11,7 @@ function Get-IcingaUpdatesPending ()
|
||||||
# Get a list of current pending updates which are not yet installed on the system
|
# Get a list of current pending updates which are not yet installed on the system
|
||||||
$Pending = $SearchIndex.Search("IsInstalled=0");
|
$Pending = $SearchIndex.Search("IsInstalled=0");
|
||||||
$PendingUpdates.Add('count', $Pending.Updates.Count);
|
$PendingUpdates.Add('count', $Pending.Updates.Count);
|
||||||
|
$PendingUpdates.Add('updates', @{ });
|
||||||
|
|
||||||
foreach ($update in $Pending.Updates) {
|
foreach ($update in $Pending.Updates) {
|
||||||
[hashtable]$PendingUpdateDetails = @{};
|
[hashtable]$PendingUpdateDetails = @{};
|
||||||
|
|
@ -60,7 +61,7 @@ function Get-IcingaUpdatesPending ()
|
||||||
$name = [string]::Format('{0} ({1})', $name, $PendingUpdateNameCache[$name]);
|
$name = [string]::Format('{0} ({1})', $name, $PendingUpdateNameCache[$name]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$PendingUpdates.Add($name, $PendingUpdateDetails);
|
$PendingUpdates.updates.Add($name, $PendingUpdateDetails);
|
||||||
}
|
}
|
||||||
} catch {
|
} catch {
|
||||||
if ($PendingUpdates.ContainsKey('Count') -eq $FALSE) {
|
if ($PendingUpdates.ContainsKey('Count') -eq $FALSE) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue