Forum Discussion
cgaines22_14499
Nimbostratus
Mar 22, 2016PowerShell Help with JSON and Invoke-WebRequest
This is the F5
$MyLTM_IP = '10.5.183.4'
Load the SnapIn first
Add-PSSnapIn iControlSnapIn
Need to create Login
$secpasswd = ConvertTo-SecureString 'password1' -AsPlainText -Force$m...
cgaines22_14499
Nimbostratus
Mar 23, 2016This Works [example](Invoke-WebRequest -Method GET -URI 'https://10.5.183.4/mgmt/tm/ltm/pool/?$filter=partition eq Certlab' -Credential $mycreds)
Brad_Parker
Cirrus
Mar 23, 2016For what its worth I would recommend using Invoke-RestMethod rather than Invoke-WebRequest. As for your question about getting a 401. You will need to authenticate with a get request before you send a PUT or POST. I'm not sure why this is the case, but it works.
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects