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
CRM_200278
Nimbostratus
Apr 29, 2016Thank you very much for the quick response Joel. I tried the method you recommended and even change the F5 being accessed but I'm still getting the same response or a similar one.
PS C:\WINDOWS\system32> $host_address = "F5_IP_Address"
$secpasswd = ConvertTo-SecureString "F5_Account_Password" -AsPlainText -Force
$mycreds = New-Object System.Management.Automation.PSCredential ("F5_Account", $secpasswd)
$F5Session = New-F5session -LTMName $host_address -LTMCredentials $mycreds -PassThrough
PS C:\WINDOWS\system32> $F5Session
Name BaseURL Credential
---- ------- ----------
F5_IP_Address https://F5_IP_Address/mgmt/tm/ltm/ System.Management.Automation.PSCredential
Up to this point no errors displayed; but , once I run the next command, the error shown below is displayed.
PS C:\WINDOWS\system32> Get-Pool -F5Session $F5Session | Select-Object -ExpandProperty fullPath
ConvertFrom-Json : Cannot bind argument to parameter 'InputObject' because it is null.
At C:\windows\system32\windowspowershell\v1.0\Modules\F5-LTM\1.3.26\Public\Invoke-RestMethodOverride.ps1:36 char:50
+ ... $message = $_.ErrorDetails.Message | ConvertFrom-json | Selec ...
+ ~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [ConvertFrom-Json], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidati NullNotAllowed,Microsoft.PowerShell.Commands.ConvertFromJsonCommand
Invoke-RestMethodOverride : " :
At C:\windows\system32\windowspowershell\v1.0\Modules\F5-LTM\1.3.26\Public\Get-Pool.ps1:32 char:21
+ ... $JSON = Invoke-RestMethodOverride -Method Get -Uri $URI -Credenti ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Invoke-RestMethodOverride
Finally, the only other information that I can add is that the SSL certificate on the F5 is self-signed and that when look at the content of the variables I can see that the correct values are contained.
Once again thanks in advance for time and attention to this matter.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)