Get-EWSService.ps1

1
2
3
4
5
6
7
8
9
10
11
12
function Get-EWSService {
    [OutputType('Microsoft.Exchange.WebServices.Data.ExchangeService')]
    [CmdletBinding()]
    Param(

    )
    if ($Script:exchangeService){
        $Script:exchangeService
    } else {
        Write-Information -MessageData "No Active Session Found" -InformationAction Continue
    }
}