F5 Sites
  • F5.com
  • LearnF5
  • NGINX
  • MyF5
  • Partner Central
Contact
  • Under Attack?
  • F5 Support
  • DevCentral Support
  • F5 Sales
  • NGINX Sales
  • F5 Professional Services
Skip to contentBrand Logo
Forums
CrowdSRC
Articles
Groups
EventsSuggestionsHow Do I...?
RegisterSign In
  1. DevCentral
  2. CrowdSRC
  3. CodeShare

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.0
devops
iControlREST
LTM
microsoft powershell with icontrol
powershell
Joel_Newton's avatar
Joel_Newton
Icon for Cirrus rankCirrus
Joined September 06, 2012
View Profile
Joel_Newton's avatar
Joel_Newton
Icon for Cirrus rankCirrus
Jul 05, 2017

[Comment Updated]

 

Hi, Daniel.

 

Cheers. I think you can just use something like the snippet below. The first part creates a hash table with all the virtual server names in it, and the second part adds the iRules assigned to each server to the hash table.

 

I don't think we'd want to modify Get-PoolMembers.ps1, because pool members aren't associated with which iRules are assigned to a virtual server. Let me know if you have any issues with the code.

 

-Joel

 

$VS_iRules = Get-VirtualServer |
    ForEach {
        New-Object psobject -Property @{
            Name = $_.name;
            Partition = $_.partition;
            Rules = @{}
        }
    }

$VS_iRules | ForEach { $_.Rules = (Get-VirtualServer -Name $_.Name -Partition $_.Partition | Select-Object -ExpandProperty rules -ErrorAction SilentlyContinue  ) } 

I updated the snippet to include the retrieve partition for each virt server and include that in the request for iRules. The output is stored in $VS_iRules, so that's probably what you want to set your $Output to, and then format as desired.

 

ABOUT DEVCENTRAL

DevCentral NewsTechnical ForumTechnical ArticlesTechnical CrowdSRCCommunity GuidelinesDevCentral EULAGet a Developer Lab LicenseBecome a DevCentral MVP

RESOURCES

Product DocumentationWhite PapersGlossaryCustomer StoriesWebinarsFree Online CoursesF5 CertificationLearnF5 Training

SUPPORT

Manage SubscriptionsProfessional ServicesProfessional ServicesCreate a Service RequestSoftware DownloadsSupport Portal

PARTNERS

Find a Reseller PartnerTechnology AlliancesBecome an F5 PartnerLogin to Partner Central

F5 logo©2024 F5, Inc. All rights reserved.
TrademarksPoliciesPrivacyCalifornia PrivacyDo Not Sell My Personal Information