Forum Discussion
jnunham_332885
Altostratus
Sep 11, 2017Issue creating multiple nodes with iControl
Hello, I'm trying to add multiple nodes to my F5 LTM from within a PowerShell script. My code works if I manually enter the name of the node and the IP address, but I'm trying to do more than 1 a...
cjunior
Nacreous
Sep 11, 2017Hello, Based on test, I think you just need to remove double quotes to expand variable on param object.
Import-CSV $csvPath -header ("Server","IPaddress") | foreach { Create-Node -nameOfNode $_.Server -nodeIPAddresses $_.IPaddress -connectionLimits 0 }
In addition, I think you could simplify the function.
function Create-Node() {
param([string]$nameOfNode,
[string]$nodeIPAddresses,
[long]$connectionLimits);
$iControl.LocalLBNodeAddressV2.create( @($nameOfNode), @($nodeIPAddresses), @($connectionLimits) );
}
Respectfully,
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects
