functions/device/Get-PSCUCMPhoneServices.ps1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
function Get-PSCUCMPhoneServices { [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseSingularNouns', '', Justification = "CUCM returns to us all of the services. We can't pick and choose which ones to return.")] [CmdletBinding()] param ( [Parameter(Mandatory = $true)] [string] $DN, [switch] $EnableException, [switch] $OutputXml ) $PhoneByDNSplat = @{ DN = $DN OutputXml = $OutputXml EnableException = $EnableException } Get-PSCUCMPhone @PhoneByDNSplat | Select-Xml -XPath '//service' | Select-Object -ExpandProperty node } |