[CmdletBinding()]
param(
    [Parameter(ParameterSetName = 'Email')]
    [string]
    $Email,

    [Parameter(ParameterSetName = 'UserName')]
    [string]
    $UserName
)

#Get-Module ITD.ServiceNow -ListAvailable | select modulebase

New-ITDServiceNowSession -Environment Test -Credential $Secret:SNowVMCred

Get-ITDServiceNowSession


switch($PSCmdlet.ParameterSetName){
    'Email' { Get-ITDServiceNowUser -Email $Email}
    'UserName' { Get-ITDServiceNowUser -Username $UserName }
}