Types/MSGraphAPI.Application.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<#
    .NOTES
    ===========================================================================
     Created with:     SAPIEN Technologies, Inc., PowerShell Studio 2017 v5.4.135
     Created on:     2/8/2017 8:24 AM
     Edited on: 2/16/2017
     Created by:     Mark Kraus
     Organization:     Mitel
     Filename:     MSGraphAPI.Application.ps1
    ===========================================================================
    .DESCRIPTION
        Contains type definition for MSGraphAPI.Application
#>


@{
    Name = 'MSGraphAPI.Application'
    DefaultDisplayPropertySet = @(
        'GUID'
        'Name'
        'Description'
        'RedirectUri'
        'ClientID'
    )
    Properties = @(
        @{
            MemberType = 'ScriptMethod'
            MemberName = 'ToString'
            Value = {
                'Guid: {0} Name: {1}' -f $This.GUID, $This.Name
            }
        }
        @{
            MemberType = 'ScriptProperty'
            MemberName = 'ClientID'
            Value = {
                $This.ClientCredential.UserName
            }
        }
        @{
            MemberType = 'ScriptMethod'
            MemberName = 'GetClientSecret'
            Value = {
                try {
                    $This.ClientCredential.GetNetworkCredential().Password
                }
                catch {
                    $null
                }

            }
        }
    )
}