Forum Discussion
tnttobin_92979
Oct 24, 2012Nimbostratus
All:
Does anyone have an example of implemting add_persistence_profile in PowerShell? This snippet below is loosely based upon this sample: https://devcentral.f5.com/wiki/iControl.PsProvisionVEForLocalDev.ashx
Example:
$Persistence = New-Object -TypeName iControl.LocalLBVirtualServerVirtualServerPersistence;
$Persistence.profile_name = "dest_addr"
$Persistence.default_profile = $true;
$Pers_ProfileA = (, $Persistence);
$Pers_ProfileAofA = (, $Pers_ProfileA);
Try {
(Get-F5.iControl).LocalLBVirtualServer.add_persistence_profile(($name, $Pers_ProfileAofA));
}
Catch {
Write-Host "Error - Adding Persistence Profile! - Exception - $_.exception" -ForegroundColor Red
}
I receive the following exception: Cannot find an overload for "add_persistence_profile" and the argument count: "1"
Any pointer would be great...I have searched all over the place and the only sample that comes close is the Java one listed here.
Thanks!
F5 Device Version: BIG-IP 10.2.1 Build 297.0 Final