Skip to content

Instantly share code, notes, and snippets.

@corbob
Created January 3, 2019 00:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save corbob/b6e3a352b5ea71e2c4c2030ae6a67ec3 to your computer and use it in GitHub Desktop.
Save corbob/b6e3a352b5ea71e2c4c2030ae6a67ec3 to your computer and use it in GitHub Desktop.
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