From 4a8e3366d8f02bc8c65fed5fbd5d50f7977af3a9 Mon Sep 17 00:00:00 2001 From: Craig Tolley Date: Tue, 30 May 2017 12:49:47 +0100 Subject: [PATCH] Added 'Superseded' to gridview --- Functions/Wsus-UpdateManager.ps1 | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Functions/Wsus-UpdateManager.ps1 b/Functions/Wsus-UpdateManager.ps1 index 5d65d67..b2784bc 100644 --- a/Functions/Wsus-UpdateManager.ps1 +++ b/Functions/Wsus-UpdateManager.ps1 @@ -3,7 +3,7 @@ # # VERSION DATE USER DETAILS # 1 03/05/2017 Craig Tolley First Version -# +# 1.1 30/05/2017 Craig Tolley Added 'Superseded' information to update details # ---------------------------------------------------------------------------------------------------------- $Global:WsusServer = $null @@ -188,10 +188,14 @@ function Get-WsusUpdatesAndApprovals { # This method was dropped as it takes around 30% longer in testing. #$UpdateApprovals = $PossibleGroups | ForEach { $Update.GetUpdateApprovals($_) } - if ($Update.IsDeclined -eq $true) { + if ($Update.IsDeclined -eq $true -and $Update.IsSuperseded -eq $true) { + $UpdateObj.ApprovalState = "Declined (Superseded)" + } + + elseif ($Update.IsDeclined -eq $true -and $Update.IsSuperseded -eq $false) { $UpdateObj.ApprovalState = "Declined" } - + elseif ($UpdateApprovals.Count -eq 0) { $UpdateObj.ApprovalState = "Unapproved" }