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
Daniel_19525
Jul 06, 2017Nimbostratus
Hey Joel,
Thanks for getting back to me. Have tried running that and it is throwing an error which I believe is related to the fact we are using partitions. I tried to remove the partition name but have had no luck.
I have taken what you posted and added the following from the Get-Poolmembers:
param(
[Parameter(Mandatory=$true)]
[string]
$LTMName,
[Parameter(Mandatory=$true)]
[System.Management.Automation.PSCredential]
$LTMCredentials,
[ValidateSet("Screen","CSV")]
$OutputDestination="Screen"
)
$Output = " "
New-F5Session -LTMName $LTMName -LTMCredentials $LTMCredentials
$VS_iRules = Get-VirtualServer |
foreach {
$VirtualServerName = $VS_iRules.Name -replace '/Common/',''
new-object psobject -Property @{
Name = $_.name;
Rules = @{}
}
}
$VS_iRules | ForEach { $_.Rules = (Get-VirtualServer -Name $_.Name | Select-Object -ExpandProperty rules -ErrorAction SilentlyContinue ) }
If ($OutputDestination -eq 'CSV'){
Write-Output $Output | Out-File -filepath '.\LTM_iRules.csv'
}
Else {
Write-Output $Output
}
Not sure I have the stripping of the partition in the right place and also not sure what values to put in for the $Output.
Really appreciate the assistance as well.
Thanks