Forum Discussion
Having trouble with LocalLBNodeAddressV2.set_description
Hi guys.
I am trying to programatically set the Node description but have been having trouble getting comfortable with knowing when to use arrays and not.
First question, is NodeAddressV2 implemented yet in the iControl dll for powershell?
Looking at the spec here: https://devcentral.f5.com/wiki/iCon...ption.ashx
Here is what I think I need:
(Get-F5.iControl).LocalLBNodeAddressV2.set_description(
(,'10.99.99.5') , 'This is my description'
);
But I'm getting a null-valued expression error.
Now the problem is previous code examples show something like this:
$definition = New-Object -TypeName iControl.CommonVirtualServerDefinition;
Is there a similar type of "Object" for Nodes and can you share an example of it?
Thanks for any help. I am familiar with PowerShell but the iControl stuff has been super confusing to me.
1 Reply
NodeAddressV2 should be in the latest version of the PowerShell Snapin for iControl. What shows up when you type in
PS> (Get-F5.iControl).LocalLBNodeAddressV2 | Get-Member
Do you see a list of available commands or do you get this message
"Get-Member : No object has been specified to the get-member cmdlet?
6/21/2012 11:28am 985088 iControlSnapinSetup.msi
The dates may be off if you download it but the size should match. You'll then likely need to re-regsiter the cmdlet with the setupSnapin.ps1 script included in the distribution.
Once you have ruled out that you don't have the correct snapin, the method you are looking at looks like it takes two string arrays. You are passing in a string array for the 1st parameter but a string scalar for the 2nd. PowerShell is usually good about fixing this for you but that may be the issue. Do something like this
PS> (Get-F5.iControl).LocalLBNodeAddressV2.set_description( (, "10.10.10.10"), (, "my description") )
If that doesn't work, pass along the exact error and I'll see what I can figure out.
Oh, and sorry about your struggles with the iControl piece of PowerShell. I'll have to loop back and do some more how-tos on how to conver the iControl APIs into the PowerShell equivalants.
-Joe
Recent Discussions
Related Content
* 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