internal/functions/Get-PSCUCMPhoneName.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 |
function Get-PSCUCMPhoneName { <# .SYNOPSIS Get the Phone Name based on Directory Number .DESCRIPTION Get the Phone Name based solely upon the Directory Number .PARAMETER DN Directory Number to get a phone name of... .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. .EXAMPLE Get-PSCUCMPhoneName -DN 1001 Gets the phone name for Directory Number 1001 #> [CmdletBinding()] param ( [Parameter(Mandatory = $true)] [string] $DN, [switch] $EnableException ) $CucmAxlSplat = @{ SqlQuery = @' SELECT device.name FROM device, numplan, devicenumplanmap WHERE devicenumplanmap.fkdevice = device.pkid AND devicenumplanmap.fknumplan = numplan.pkid AND numplan.dnorpattern = "{0}" '@ -f $DN EnableException = $EnableException } Invoke-PSCUCMSqlQuery @CucmAxlSplat } |