Hello, I'm trying to create a simple template for changing interface descriptions based on the input of the user. Everything seems to be working except after generating a script when I look to see the commands it properly enters the interface(s) that were selected but the actual description which is in a variable gives an error instead. I'm sure I am making a simplet mistake but wanted to post my example to see where I am going wrong.
Script:
/*
.PARAMETER_LABEL @ContextNode
NCM node
.PARAMETER_DESCRIPTION @ContextNode
The node the template will operate on. All templates require this by default. The target node is selected during the first part of the wizard so it will not be available for selection when defining values of variables.
.PARAMETER_LABEL @TargetPorts
Select Port(s)
.PARAMETER_DESCRIPTION @TargetPorts
Select the port(s) for which you would like to change Interface descriptions.
.PARAMETER_LABEL @ItfCommands
Interface description
.PARAMETER_DESCRIPTION @ItfCommands
Enter the description for the interfaces selected.
*/
script ChangeInterfaceDescription (
NCM.Nodes @ContextNode,
NCM.Interfaces[] @TargetPorts,
string[] @ItfCommands )
{
// Enter configuration mode
CLI
{
configure terminal
}
foreach (@portItem in @TargetPorts)
{
CLI
{
interface @TargetPorts.InterfaceDescription
}
CLI
{
description @ItfCommands
}
CLI
{
exit
}
}
}