Public/Invoke-CucmSql.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
function Invoke-CucmSql {
    [CmdletBinding()]
    param (
        [Parameter(Mandatory = $true)]
        [string]
        $SqlQuery,
        [string]
        $AXLVersion = '11.5',
        [Parameter(Mandatory = $true)]
        [string]
        $server,
        [Parameter(Mandatory = $true)]
        [pscredential]
        $Credential
    )
    $CucmAxlSplat = @{
        'server'     = $server
        'entity'     = 'executeSQLQuery'
        'parameters' = @{
            'sql' = $SqlQuery
        }
        'AXLVersion' = $AXLVersion
        'Credential' = $Credential
    }
    Invoke-CucmAxl @CucmAxlSplat
}