Forum Discussion

Mitesh_378646's avatar
Mitesh_378646
Icon for Nimbostratus rankNimbostratus
Jan 11, 2019

Troubleshooting Invoke-RestMethod API call.

Hi Experts, In one of my scenario i am trying to remove iRule from virtual server by calling "Remove-iRuleFromVirtualServer.ps1" which is internally calling below somewhere.

 

$Result = Invoke-RestMethod @PSBoundParameters but this is throwing me an exception as below and I am not sure where exactly to look into.

 

Invoke-RestMethod : {"code":400,"message":"\"virtual\" unexpected argument","errorStack":[],"apiError":26214401} At C:\Users\mitesh.neema\Documents\WorkingPSStructure_Copy\Invoke-F5RestMethod.ps1:30 char:19 + $Result = Invoke-RestMethod @PSBoundParameters + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand

 

 Actual file can be found here:

https://github.com/joel74/POSH-LTM-Rest/blob/master/F5-LTM/Public/Invoke-RestMethodOverride.ps1L26

 

Notice line number26.

 

Any help

 

No RepliesBe the first to reply