functions/Mde/software/Get-MdSoftwareVulnerability.ps1
function Get-MdSoftwareVulnerability { <# .SYNOPSIS Retrieve a list of vulnerabilities in the installed software. .DESCRIPTION Retrieve a list of vulnerabilities in the installed software. Scopes required (delegate auth): Vulnerability.Read .PARAMETER SoftwareID ID of the software for which to retrieve devices that have it installed. .EXAMPLE PS C:\> Get-MdSoftwareVulnerability -SoftwareID $softwareid Retrieve a list of vulnerabilities in the installed software. .LINK https://docs.microsoft.com/en-us/microsoft-365/security/defender-endpoint/get-vuln-by-software?view=o365-worldwide #> [CmdletBinding(DefaultParameterSetName = 'default')] param ( [Parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, ParameterSetName = 'default')] [Alias('Id')] [string] $SoftwareID ) 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 = 'software/{SoftwareID}/vulnerabilities' -Replace '{SoftwareID}',$SoftwareID Method = 'get' RequiredScopes = 'Vulnerability.Read' } $__param += $PSBoundParameters | ConvertTo-HashTable -Include 'ErrorAction', 'WarningAction', 'Verbose' try { Invoke-DefenderAPIRequest @__param } catch { $PSCmdlet.ThrowTerminatingError($_) } } } |