Add missing parameter name to Write-Warning and Write-Error

This commit is contained in:
Emin 2020-11-12 10:59:22 +01:00
Родитель b2cc39e4e9
Коммит eb2a62dd81
4 изменённых файлов: 9 добавлений и 9 удалений

Просмотреть файл

@ -199,5 +199,5 @@ InModuleScope MsrcSecurityUpdates {
#When a pester test fails, it writes out to stdout, and sets an error in $Error. When invoking powershell from C# it is a lot easier to read the stderr stream.
if($Error)
{
Write-Error 'A pester test has failed during the validation process'
Write-Error -Message 'A pester test has failed during the validation process'
}

Просмотреть файл

@ -113,7 +113,7 @@ Process {
$response = Invoke-RestMethod @RestMethod
} catch {
Write-Error "HTTP Get failed with status code $($_.Exception.Response.StatusCode): $($_.Exception.Response.StatusDescription)"
Write-Error -Message "HTTP Get failed with status code $($_.Exception.Response.StatusCode): $($_.Exception.Response.StatusDescription)"
}
# Invoke-RestMethod will return an string on PowerShell 4.0 and earlier

Просмотреть файл

@ -204,11 +204,11 @@ Process {
$r = Invoke-RestMethod @RestMethod
} catch {
Write-Error "HTTP Get failed with status code $($_.Exception.Response.StatusCode): $($_.Exception.Response.StatusDescription)"
Write-Error -Message "HTTP Get failed with status code $($_.Exception.Response.StatusCode): $($_.Exception.Response.StatusDescription)"
}
if (-not $r) {
Write-Warning 'No results returned from the /Update API'
Write-Warning -Message 'No results returned from the /Update API'
} else {
$r.Value
}

Просмотреть файл

@ -169,7 +169,7 @@ Process {
'Low' { 'Low' ; break }
'None' { 'None' ; break }
default {
Write-Warning "Could not determine the Maximum Severity from the Threats for $($v.CVE)"
Write-Warning -Message "Could not determine the Maximum Severity from the Threats for $($v.CVE)"
'Unkwown'
}
}
@ -181,7 +181,7 @@ Process {
if ($ImpactValues = ($v.Threats | Where-Object { $_.Type -eq 0 }).Description.Value | Select-Object -Unique) {
$impactColumn = $ImpactValues -join ',<br>'
} else {
Write-Warning "Could not determine the Impact from the Threats for $($v.CVE)"
Write-Warning -Message "Could not determine the Impact from the Threats for $($v.CVE)"
$impactColumn = 'Unknown'
}
@ -206,7 +206,7 @@ Process {
if ($cveTitle = $v.Title.Value) {
$cveTitle
} else {
Write-Warning "Missing Title for $($v.CVE)"
Write-Warning -Message "Missing Title for $($v.CVE)"
($cveTitle = 'Unknown')
}
),
@ -367,7 +367,7 @@ Process {
if ($ExploitStatusThreat = ($v.Threats | Where-Object { $_.Type -eq 1 } | Select-Object -Last 1).Description.Value) {
$ExploitStatus = Get-MsrcThreatExploitStatus -ExploitStatusString $ExploitStatusThreat
} else {
Write-Warning "Missing ExploitStatus for $($v.CVE)"
Write-Warning -Message "Missing ExploitStatus for $($v.CVE)"
}
$cveSectionHtml += $exploitabilityIndexTableHtml -f @(
@ -555,7 +555,7 @@ Process {
$ackVal += '<br><br>'
}
} else {
Write-Warning "No Acknowledgments for $($v.CVE)"
Write-Warning -Message "No Acknowledgments for $($v.CVE)"
$ackVal = 'None'
}