Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Windows Update Missing Patches for Backup Server #149

Closed
2 tasks done
rebelinux opened this issue Apr 15, 2024 · 0 comments · Fixed by #157
Closed
2 tasks done

Add Windows Update Missing Patches for Backup Server #149

rebelinux opened this issue Apr 15, 2024 · 0 comments · Fixed by #157
Assignees
Labels
change request Request a new change or an improvement
Milestone

Comments

@rebelinux
Copy link
Collaborator

Description

Add Windows Update Missing Patches to the report.

try {
    $UpdObj = @()
    $Updates = Invoke-Command -Session $TempPssSession -ScriptBlock { (New-Object -ComObject Microsoft.Update.Session).CreateupdateSearcher().Search("IsHidden=0 and IsInstalled=0").Updates | Select-Object Title, KBArticleIDs }
    $UpdObj += if ($Updates) {
        $OutObj = @()
        foreach ($Update in $Updates) {
            try {
                $inObj = [ordered] @{
                    'KB Article' = "KB$($Update.KBArticleIDs)"
                    'Name' = $Update.Title
                }
                $OutObj += [pscustomobject]$inobj

                if ($HealthCheck.OperatingSystem.Updates) {
                    $OutObj | Set-Style -Style Warning
                }
            } catch {
                Write-PScriboMessage -IsWarning $_.Exception.Message
            }
        }
        $TableParams = @{
            Name = "Missing Windows Updates"
            List = $false
            ColumnWidths = 40, 60
        }
        if ($Report.ShowTableCaptions) {
            $TableParams['Caption'] = "- $($TableParams.Name)"
        }
        $OutObj | Sort-Object -Property 'Name' | Table @TableParams
    }
    if ($UpdObj) {
        Section -Style Heading3 'Missing Windows Updates' {
            Paragraph "The following section provides a summary of pending/missing windows updates."
            BlankLine
            $UpdObj
        }
    }
} catch {
    Write-PScriboMessage -IsWarning $_.Exception.Message
}

Additional Context

Requested by User (email)

Before submitting

  • I have read the documentation, and referred to the known issues before submitting this change request.
  • I have checked for previously opened & closed issues before submitting this change request.
@rebelinux rebelinux added the change request Request a new change or an improvement label Apr 15, 2024
@rebelinux rebelinux self-assigned this Apr 15, 2024
@rebelinux rebelinux changed the title Add Windows Update Missing Patches Add Windows Update Missing Patches for Backup Server Apr 24, 2024
@rebelinux rebelinux added this to the v0.8.6 milestone Apr 24, 2024
rebelinux added a commit to rebelinux/AsBuiltReport.Veeam.VBR that referenced this issue Apr 25, 2024
This was referenced Apr 25, 2024
@rebelinux rebelinux mentioned this issue Apr 30, 2024
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
change request Request a new change or an improvement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant