Remove-Indicatior.ps1
Function Remove-Indicatior { <# .SYNOPSIS Remove Defender indicatior. .PARAMETER Token Authorization token. .PARAMETER Id Indicatior id. .EXAMPLE Remove-Indicatior -Token $Token -Id 5 .NOTES Author: Michal Gajda .LINK https://docs.microsoft.com/en-us/microsoft-365/security/defender-endpoint/post-ti-indicator?view=o365-worldwide #> [CmdletBinding()] Param ( [Parameter(Mandatory = $true)] $Token, [Parameter(Mandatory = $true)] [Int]$Id ) Begin {} Process { $Headers = @{ 'Content-Type' = 'application/json' Accept = 'application/json' Authorization = "Bearer $Token" } $Uri = "https://api.securitycenter.windows.com/api/indicators/$Id" $Request = @{ Method = "DELETE" Uri = $Uri Headers = $Headers ErrorAction = "Stop" } $Response = Invoke-RestMethod @Request Return $Response } End {} } |