functions/utility/Invoke-PSCUCMSqlQuery.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 |
function Invoke-PSCUCMSqlQuery { <# .SYNOPSIS Invoke a SQL Query against CUCM Server. .DESCRIPTION Invoke a SQL Query against CUCM Server. .PARAMETER SqlQuery SQL Query to invoke. .PARAMETER EnableException Replaces user friendly yellow warnings with bloody red exceptions of doom! Use this if you want the function to throw terminating errors you want to catch. .PARAMETER OutputXml Output just XML .EXAMPLE Invoke-PSCUCMSqlQuery -SqlQuery "Select * from phones" Will execute the query against the CUCM server. This is probably a bad query... Do *not* try this at home. #> [CmdletBinding()] param ( [Parameter(Mandatory = $true)] [string] $SqlQuery, [switch] $EnableException, [switch] $OutputXml ) $CucmAxlSplat = @{ entity = 'executeSQLQuery' parameters = @{ sql = $SqlQuery } EnableException = $EnableException OutputXml = $OutputXml } Invoke-PSCUCMAxlQuery @CucmAxlSplat } |