public/Remove-NexposeVulnerabilityException.ps1
Function Remove-NexposeVulnerabilityException { <# .SYNOPSIS Deletes a vulnerability exception .DESCRIPTION Deletes a vulnerability exception .PARAMETER Id The identifier of the exception .EXAMPLE Remove-NexposeVulnerabilityException -Id 23 .NOTES For additional information please see my GitHub wiki page .FUNCTIONALITY DELETE: vulnerability_exceptions/{id} .LINK https://github.com/My-Random-Thoughts/Rapid7Nexpose #> [CmdletBinding(SupportsShouldProcess)] Param ( [Parameter(Mandatory = $true, ValueFromPipeline = $true)] [int[]]$Id ) Begin { } Process { [int[]]$pipeLine = $input | ForEach-Object { $_ } # $input is an automatic variable If ($pipeLine) { $Id = $pipeLine } ForEach ($item In $Id) { If ($PSCmdlet.ShouldProcess($item)) { Write-Output (Invoke-NexposeQuery -UrlFunction "vulnerability_exceptions/$item" -RestMethod Delete) } } } End { } } |