Forum Discussion
Powershell New-F5Session and close session issues.
Hi, We have some automation around some F5 functionality. We have moved from 1 F5 to 2 F5s, one for external apps and one for internal apps. In our powershell automation we now have to create two different F5 sessions depending on which F5 we want to make changes in. I have a snippet of the PS code below.
Is there any way to close the session that was opened and then create a new session?
We are finding the creating a New-F5session when one has already been created doesnt work and still uses the first session opened.
Can I have 2 sessions and use the Add-iRuleToVirtualServer with some sessionID?
$ltmip = "1.2.3.4"
$ltmip_inside = "1.3.3.4"
if ($vipName.ToLower() -contains "internal") {
$session = New-F5Session -LTMName $ltmip_inside -LTMCredentials $mycreds
} else {
$session = New-F5Session -LTMName $ltmip -LTMCredentials $mycreds
}
.
.
.
$add = Add-iRuleToVirtualServer -InputObject $vipObject -iRuleName $all_MaintRule
- JRahmAdmin
Hi LanceLyons, this issue on Joel's github repo for this might provide some insight to the issue you're facing.
- LanceLyonsCirrus
Hi JRahm, Thanks. I did also post over there. Headed over there to see if there was any response.
I posted in this area https://github.com/joel74/POSH-LTM-Rest/issues not sure if that was the right one but it seemed to have the most activity.
thanks
Lance
- JRahmAdmin
Did you try the passthru switch Joel mentioned in the issue I shared? Seems to be the same scenario you mentioned, but posh is not my jam so I'm just throwing ideas out.
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