Private/Find-NSPEntraPairADUser.ps1

function Find-NSPEntraPairADUser {
    <#
    .SYNOPSIS
        Wildcard AD search for the review. A term without * is searched as *term*. Read-only.
    #>

    [CmdletBinding()]
    param(
        [Parameter(Mandatory)][string]$Term,
        [Parameter(Mandatory)][string]$Server,
        [switch]$Forest
    )

    Import-NSPToolkitModule -Name 'NSP.ActiveDirectory'
    if (-not (Get-Command Get-NSPADUser -ErrorAction SilentlyContinue)) { throw 'This NSP.ActiveDirectory has no Get-NSPADUser. Update it.' }
    $read = @{ Filter = $(if ($Term.Contains('*')) { $Term } else { "*$Term*" }); Server = $Server }
    if ($Forest) { $read.Forest = $true }
    @(Get-NSPADUser @read)
}