#Pick a group to approve an update for$group = $wsus.GetComputerTargetGroups() |? {$_.Name-eq"Domain Servers"}#Define the actions available for approving a patch$all = [Microsoft.UpdateServices.Administration.UpdateApprovalAction]::All$install = [Microsoft.UpdateServices.Administration.UpdateApprovalAction]::Install$NotApproved = [Microsoft.UpdateServices.Administration.UpdateApprovalAction]::NotApproved$Uninstall = [Microsoft.UpdateServices.Administration.UpdateApprovalAction]::Uninstall#Approve the update$update.Approve($install,$group)
Using UpdateServices
import-module -name UpdateServices
Upprove the updates
Get-WsusUpdate-Classification All -Approval Unapproved |Approve-WsusUpdate-Action Install -TargetGroupName "All Computers"