Hi Conny!
You can actually fetch an array of pools at the same time which reduces overhead alot.
Something like this:
if ( (Get-PSSnapin | Where-Object { $_.Name -eq "iControlSnapIn"}) -eq $null ){
Add-PSSnapIn iControlSnapIn
}
$user = 'myuser'
$pass = 'mypassword'
$success = Initialize-F5.iControl -Username $user -Password $pass -HostName 1.1.1.1
$f5 = Get-F5.iControl
$PoolList = $f5.LocalLBPool.get_list()
$ActionServiceDown = $f5.LocalLBPool.get_action_on_service_down($PoolList)
$LBMethod = $f5.LocalLBPool.get_lb_method($PoolList)
for($i=0;$i -lt ($PoolList.Count);$i++){
Pool Name
$PoolList[$i]
Action on service down
$ActionServiceDown[$i]
Load balancing method
$LBMethod[$i]
}
/Patrik