Forum Discussion
Create a menu from a dynamic list of pool members
I am attempting to populate a Powershell menu from a "(Get-F5.iControl).LocalLBPool.get_member_v2" statement and I am having difficulty getting this to work. Here is the code I am using, is there anyone that can help me out?
When I run this code I get a menu but it does not display the members.
Thanks for any help you can provide.
$g_pool = "/XXX/XXX" $member_lists = (Get-F5.iControl).LocalLBPool.get_member_v2, $g_pool; $menu = @{} for ($i=1;$i -le $member_lists.count; $i++) { Write-Host "$i. $($member_lists[$i-1].address)" $menu.Add($i,($member_lists[$i-1].address)) } [int]$ans = Read-Host 'Select Your Desired Server' $g_member = $menu.Item($ans)
Write-Host "You Selected" $g_member write-host $g_member
1 Reply
- Vijay_E
Cirrus
Can you format the code ? Which code version are you running on the F5 ?
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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