VConnectAppSettings.psm1

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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
function Get-VConnectAppSetting {
    param (
          [Parameter(Mandatory=$true, Position= 0)]
          $endpointName,
          [Parameter(Mandatory=$true, Position= 1)]
          $group,
          [Parameter(Mandatory=$false, Position= 2)]
          $key
    )
    if($key -eq $null ) {
        return Invoke-RestApiRequest -endpointName $endpointName -relativeUrl "admin/config/GetAppSettings?groups=$group" -method 'GET'
    }
    return Invoke-RestApiRequest -endpointName $endpointName -relativeUrl "admin/config/GetAppSetting?group=$group&key=$key" -method 'GET'
}

function Get-VConnectAppSettingGroups {
    param (
          [Parameter(Mandatory=$true, Position= 0)]
          $endpointName
    )
    return Invoke-RestApiRequest -endpointName $endpointName -relativeUrl "admin/config/ListAppSettingGroups" -method 'GET'
}

function Set-VConnectAppSetting {
    param (
          $endpointName,
          $group,
          $key,
          $value,
          [bool]$isEncrypted
    )
    $data = @{
                Key = $key
                Group = $group
                Value = $value
                IsEncrypted = $isEncrypted
    }
    $dataJson = $data | ConvertTo-Json
    return Invoke-RestApiRequest -endpointName $endpointName -relativeUrl 'admin/config/AddOrUpdateAppSetting' -method 'POST' -jsonBody $dataJson
}
# SIG # Begin signature block
# MIIQQAYJKoZIhvcNAQcCoIIQMTCCEC0CAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB
# gjcCAQSgWzBZMDQGCisGAQQBgjcCAR4wJgIDAQAABBAfzDtgWUsITrck0sYpfvNR
# AgEAAgEAAgEAAgEAAgEAMCEwCQYFKw4DAhoFAAQUetyKuBV8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