From d8d87a7665220fcb651d874fa7f3be677729c0dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lari=20Lehtom=C3=A4ki?= Date: Fri, 8 May 2026 15:19:41 +0300 Subject: [PATCH] Fix DivideByZero error when the input is only one vulnerability Cast the input to array to handle be special case of input being only one vulnerability object. Following example code returns divide by zero error as the input is an object instead of array of objects: ``` $cvrfDoc = Get-MsrcCvrfDocument -ID 2016-Nov $HT = @{ Vulnerability = ($cvrfDoc.Vulnerability | Where-Object {$_.CVE -In @('CVE-2016-0026')}) ProductTree = $cvrfDoc.ProductTree } Get-MsrcVulnerabilityReportHtml @HT | Out-File -FilePath Cvrf-CVE-Summary.html ``` --- .../Public/Get-MsrcVulnerabilityReportHtml.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MsrcSecurityUpdates/Public/Get-MsrcVulnerabilityReportHtml.ps1 b/src/MsrcSecurityUpdates/Public/Get-MsrcVulnerabilityReportHtml.ps1 index 3bf9f1e..8afb526 100644 --- a/src/MsrcSecurityUpdates/Public/Get-MsrcVulnerabilityReportHtml.ps1 +++ b/src/MsrcSecurityUpdates/Public/Get-MsrcVulnerabilityReportHtml.ps1 @@ -46,7 +46,7 @@ Function Get-MsrcVulnerabilityReportHtml { Param( [Parameter(Mandatory,ValueFromPipelineByPropertyName)] - $Vulnerability, + [array]$Vulnerability, [Parameter(Mandatory,ValueFromPipelineByPropertyName)] $ProductTree,