forked from gildas/posh-ic
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathGet-ICAttendantInboundProfile.ps1
41 lines (36 loc) · 1.09 KB
/
Get-ICAttendantInboundProfile.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
<#
# AUTHOR : Paul McGurn
#>
function Get-ICAttendantInboundProfile() {
<#
.SYNOPSIS
Gets an attendant profile by ID
.DESCRIPTION
Gets an attendant profile by ID
.PARAMETER ICSession
The Interaction Center Session
.PARAMETER ProfileId
The Interaction Center Attendant Profile ID
#>
[CmdletBinding()]
Param(
[Parameter(Mandatory = $true)] [Alias("Session", "Id")] $ICSession,
[Parameter(Mandatory = $true)] [Alias("Profile")] [string] $ProfileId
)
$headers = @{
"Accept-Language" = $ICSession.language;
"ININ-ICWS-CSRF-Token" = $ICSession.token;
}
$response = '';
$requesturi = "$($ICsession.baseURL)/$($ICSession.id)/configuration/attendant-inbound-profiles/$($ProfileId)?select=*"
try {
$response = Invoke-RestMethod -Uri $requesturi -Method Get -Headers $headers -WebSession $ICSession.webSession
}
catch {
# If user not found, ignore the exception
if (-not ($_.Exception.message -match '404')) {
Write-Verbose "Profile not found, exiting silently"
}
}
return $response
}