PowerShell module for the F5 LTM REST API
Problem this snippet solves: To report an issue with the F5-LTM or F5-BIGIP modules, please use the Issues sections of the GitHub repos (here and here) instead of commenting here. Thanks!
This Pow...
Updated Jun 06, 2023
Version 2.0Joel_Newton
Cirrus
Joined September 06, 2012
Meganathan
Apr 21, 2020Nimbostratus
HI Joel,
Using the below code I am able to add iRule to the virtual server it's adding iRule to bottom. I want to add the iRule at the top.
Any suggestions?
Import-Module F5-LTM -Force -ErrorAction Stop
$LTMName = "10.0.0.1"
$virtualservername = "xx_xxxxxx-xxxx-xxxx1"
$F5Session = New-F5Session -LTMName "$LTMName" -LTMCredentials (Get-Credential) -passthru
[array]$iRules = Get-VirtualServeriRuleCollection -VirtualServer $VirtualServername -F5session $F5session
$iRuleToAdd = "/Common/iRule-xxxxxxxxxxx"
#adding iRule to top of the array
$iRules = ,$iRuleToAdd + $iRules
foreach($irule in $irules){
Add-iRuleToVirtualServer -F5Session $F5Session -Name $VirtualServerName -iRuleName $irule -verbose
}