Forum Discussion
Martin_B__246_r
Nimbostratus
Sep 13, 2016list applied Irules for a specified VIP
Hi,
Is there a way to list applied Irules for a specified VIP with Powershell?
Michael_Jenkins
Cirrostratus
Sep 13, 2016While all this could be done in fewer lines just as easily, here's some code that should help using iControlRest.
$f5Host = "f5.example.com";
$f5Cred = (Get-Credential);
$prefix = "https://$f5Host/mgmt/tm";
$vip = "/MY_VIP_NAME"; You can leave this variable blank to return all the VIPs and their iRules
$resp = Invoke-RestMethod -Method GET -Uri "$prefix/ltm/virtual$($vip)?`$select=fullPath,rules" -Credential $f5Cred;
$list = ($resp.items, $resp, 1 -ne $null)[0]; REF: http://stackoverflow.com/questions/10623907/null-coalescing-in-powershell
$list;Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects