PowerShell module for the F5 LTM REST API
Updated Jun 06, 2023
Version 2.0Was this article helpful?
Would you please update the document to include the correct process for establishing the connection? Powershell doesn't use parentheses when passing parameters. While the comments section is helpful, a newbie (like myself) would have thought the document as displayed was correct.
`Function F5-Connect {
if ( (Get-Module | Where-Object { $_.Name -eq "F5-LTM"}) -eq $null ) {
Write-error "'F5-LTM' is not installed on this computer."
Exit
} else {
Connect to the F5 Load Balancer using the predefined credentials for node management
$myhost = 'myf5.mycompany.com'
$myuser = 'f5adminusername'
$mysecpass = ConvertTo-SecureString "f5adminpassword" -AsPlainText -Force
$mycreds = New-Object System.Management.Automation.PSCredential $myuser, $mysecpass
$SessionToken = New-F5Session -LTMName $myhost -LTMCredentials $mycreds -Passthrough
}
Return $SessionToken
} `