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

Get-KBDownloadurl script issue with url value #35

Closed
chilleregeravi opened this issue May 22, 2018 · 0 comments
Closed

Get-KBDownloadurl script issue with url value #35

chilleregeravi opened this issue May 22, 2018 · 0 comments
Labels

Comments

@chilleregeravi
Copy link

chilleregeravi commented May 22, 2018

$KBArticleObject | 
        ForEach-Object {
            $kb = $_
            #In older months, there won't be a subtype. Handle this so there are not empty ()'s
            if($kb.SubType){
                $HTML_TO_RETURN += $('<a href="{0}" >{1} ({2})' -f $kb.URL, $kb.ID, $kb.SubType)
            } else {
                $HTML_TO_RETURN += $('<a href="{0}" >{1}' -f $kb.URL, $kb.ID)
            }

This script under Process takes data from Get-MSrcCVRFAffectedSoftware, where $KB = $_ .However there does not exist a $KB.subtype, as $KB is a sub object under Get-MsrcCVRFAffectedSoftware output object.

Example of one output object of Get-MsrcCVRFAffectedSoftware

FullProductName : Windows Server 2008 for x64-based Systems Service Pack 2
KBArticle : @{ID=4131188; URL=https://catalog.update.microsoft.com/v7/site/Search.aspx?q=KB4131188; SubType=Security Update}
CVE : CVE-2018-8120
Severity : Important
Impact : Elevation of Privilege
RestartRequired : Yes
Supercedence : 4093224
CvssScoreSet : @{base=7.00; temporal=6.30; vector=CVSS:3.0/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H/E:P/RL:O/RC:C}

Hence the line $KB = $_ should actually be $kb = $_.KBArticle

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants