internal/functions/Method11.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
32
33
34
35
36
37
Function Method11 {
    <#
    .SYNOPSIS
    Method to get user's OOF Settings.
     
    .DESCRIPTION
    Method to get user's OOF Settings.
     
    .EXAMPLE
    PS C:\> Method11
    Method to get user's OOF Settings.
 
    #>

    [CmdletBinding()]
    param(
        # Parameters
    )
    $statusBar.Text = "Running..."
    $array = New-Object System.Collections.ArrayList
    $output = $service.GetUserOofSettings($email) | Select-Object `
        State, `
        ExternalAudience, `
        @{ Name = "StartTime" ; Expression = { $service.GetUserOofSettings($email).Duration.StartTime.ToString() } }, `
        @{ Name = "EndTime" ; Expression = { $service.GetUserOofSettings($email).Duration.EndTime.ToString() } }, `
        @{ Name = "InternalReply" ; Expression = { $service.GetUserOofSettings($email).InternalReply.Message } }, `
        @{ Name = "ExternalReply" ; Expression = { $service.GetUserOofSettings($email).ExternalReply.Message } }, `
        AllowExternalOof
    $array.Add($output)

    $dgResults.datasource = $array
    $dgResults.AutoResizeColumns()
    $dgResults.Visible = $True
    $txtBoxResults.Visible = $False
    $PremiseForm.refresh()
    $statusBar.Text = "Ready..."
    Write-PSFMessage -Level Host -Message "Task finished succesfully" -FunctionName "Method 11"
}