CyConvenience.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<#
.SYNOPSIS
 A collection of convenience verbs to work with the Cylance Console API v2.
 
.DESCRIPTION
    Contains methods that are helpful, but do not represent API primitives, or are wrappers around API methods.
 
.LINK
    Blog: http://tietze.io/
    Jan Tietze
#>


<#
.SYNOPSIS
    Gets a user by email
 
.PARAMETER Email
    The user's email address
#>

function Get-CyUserByEmail {
    [CmdletBinding(DefaultParameterSetName="All")] 
    Param (
        [parameter(Mandatory=$false)]
        [CylanceAPIHandle]$API = $GlobalCyAPIHandle,
        [parameter(Mandatory=$true)]
        [string]$Email
        )

    Get-CyUserList -API $API | Where-Object email -eq $Email
}