functions/Mde/recommendations/Get-MdRecommendationVulnerability.ps1
function Get-MdRecommendationVulnerability { <# .SYNOPSIS Retrieves a list of vulnerabilities associated with the security recommendation. .DESCRIPTION Retrieves a list of vulnerabilities associated with the security recommendation. Scopes required (delegate auth): Vulnerability.Read .PARAMETER RecommendationID ID of the recommendation for which to retrieve vulnerabilities. .EXAMPLE PS C:\> Get-MdRecommendationVulnerability -RecommendationID $recommendationid Retrieves a list of vulnerabilities associated with the security recommendation. .LINK https://docs.microsoft.com/en-us/microsoft-365/security/defender-endpoint/get-recommendation-vulnerabilities?view=o365-worldwide #> [CmdletBinding(DefaultParameterSetName = 'default')] param ( [Parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, ParameterSetName = 'default')] [Alias('Id')] [string] $RecommendationID ) process { $__mapping = @{ } $__param = @{ Body = $PSBoundParameters | ConvertTo-HashTable -Include @() -Mapping $__mapping Query = $PSBoundParameters | ConvertTo-HashTable -Include @() -Mapping $__mapping Header = $PSBoundParameters | ConvertTo-HashTable -Include @() -Mapping $__mapping Path = 'recommendations/{RecommendationID}/vulnerabilities' -Replace '{RecommendationID}',$RecommendationID Method = 'get' RequiredScopes = 'Vulnerability.Read' } $__param += $PSBoundParameters | ConvertTo-HashTable -Include 'ErrorAction', 'WarningAction', 'Verbose' try { Invoke-DefenderAPIRequest @__param } catch { $PSCmdlet.ThrowTerminatingError($_) } } } |