diff --git a/CyCLI.psm1 b/CyCLI.psm1 index 38ba001..b4962a1 100644 Binary files a/CyCLI.psm1 and b/CyCLI.psm1 differ diff --git a/CyUsers.ps1 b/CyUsers.ps1 index a2bb0f5..26d31a6 100644 --- a/CyUsers.ps1 +++ b/CyUsers.ps1 @@ -38,3 +38,23 @@ function Get-CyUserDetail { Invoke-RestMethod -Method GET -Uri $url -Header $headers -UserAgent "" | Convert-CyObject } } + +function Remove-CyUser { + Param ( + [parameter(Mandatory=$false)] + [ValidateNotNullOrEmpty()] + [CylanceAPIHandle]$API = $GlobalCyAPIHandle, + [parameter(ParameterSetName="ByUserId", Mandatory=$true)] + [object[]]$UserId + ) + + Process { + $headers = @{ + "Authorization" = "Bearer $($API.AccessToken)" + } + + $url = "$($API.BaseUrl)/users/v2/$($UserId)" + + Invoke-RestMethod -Method DELETE -Uri $url -Header $headers + } +} \ No newline at end of file