Created
January 3, 2019 00:12
-
-
Save corbob/b6e3a352b5ea71e2c4c2030ae6a67ec3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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