OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

MSRC Security Updates API Filter By Product

  • Thread starter Thread starter Stephen C
  • Start date Start date
S

Stephen C

Guest
The sample code shows how to filter by CVE and hints that you can filter by product. But there is only one product tree. How do you filter by product?

Code:
$CVEsWanted = @(
        "CVE-2017-0001", 
        "CVE-2017-0005"
        )
$CVRFHtmlProperties = @{
    Vulnerability = $CVRFDoc.Vulnerability | Where-Object {$_.CVE -in $CVEsWanted}
    ProductTree = $CVRFDoc.ProductTree
}
Get-MsrcVulnerabilityReportHtml @CVRFHtmlProperties -Verbose | Out-File $Output_Location

I tried something like this, but this just filters within the Product tree.

Code:
$Products = @(
        "Windows 10 Version 1809 for x64-based Systems", 
        "Windows Server 2016",
        "Windows Server 2016 (Server Core installation)"
        )

$ProductsOfInterest = $CVRFDoc.ProductTree.FullProductName | Where-Object {$_.Value -in $Products}

I think I have to make a whole new ProductTree object with just the items I want in it, but that seems overly complicated for the API.
<p>The <a href="https://github.com/microsoft/MSRC-Microsoft-Security-Updates-API/blob/main/src/README.md" rel="nofollow noreferrer">sample code</a> shows how to filter by CVE and hints that you can filter by product. But there is only one product tree. How do you filter by product?</p>
<pre><code>$CVEsWanted = @(
"CVE-2017-0001",
"CVE-2017-0005"
)
$CVRFHtmlProperties = @{
Vulnerability = $CVRFDoc.Vulnerability | Where-Object {$_.CVE -in $CVEsWanted}
ProductTree = $CVRFDoc.ProductTree
}
Get-MsrcVulnerabilityReportHtml @CVRFHtmlProperties -Verbose | Out-File $Output_Location
</code></pre>
<p>I tried something like this, but this just filters within the Product tree.</p>
<pre><code>$Products = @(
"Windows 10 Version 1809 for x64-based Systems",
"Windows Server 2016",
"Windows Server 2016 (Server Core installation)"
)

$ProductsOfInterest = $CVRFDoc.ProductTree.FullProductName | Where-Object {$_.Value -in $Products}
</code></pre>
<p>I think I have to make a whole new ProductTree object with just the items I want in it, but that seems overly complicated for the API.</p>
Continue reading...
 
Top