Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
function Add-MyPhone {
[CmdletBinding(SupportsShouldProcess, ConfirmImpact = 'Low')]
param (
[Parameter(Mandatory = $true)]
[string]
$PhoneName,
[Parameter(Mandatory = $true)]
[ValidateSet('Cisco 6941', 'Cisco 7841', 'Cisco 7942')]
[string]
$Product,
[Parameter(Mandatory = $true)]
[string]
$DevicePoolName,
[Parameter(Mandatory = $true)]
[string]
$Protocol
)
$PhoneSplat = @{
Server = 'MyServer'
Credential = [System.Management.Automation.PSCredential]::new('user', (ConvertTo-SecureString -String 'password' -AsPlainText -Force))
AXLVersion = '11.5'
MacAddress = $PhoneName
Product = $Product
ProtocolSide = 'User'
devicePoolName = $DevicePoolName
commonPhoneConfigName = 'Standard Common Phone Profile'
phoneTemplateName = "Standard $($product.split(' ')[1]) $Protocol"
Protocol = $Protocol
}
Add-Phone @PhoneSplat
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment