Forum Discussion
cgaines22_14499
Mar 23, 2016Nimbostratus
This Works [example](Invoke-WebRequest -Method GET -URI 'https://10.5.183.4/mgmt/tm/ltm/pool/?$filter=partition eq Certlab' -Credential $mycreds)
- Brad_ParkerMar 23, 2016CirrusFor 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.
- cgaines22_14499Mar 23, 2016NimbostratusThanks Brad that changed the look of the Get request to a short return versus using Invoke-WebRequest. They both return values but Invoke-RestMethod seems to only refer to the object in the URI not the whole URI list. I will try the Get statement before the Post statement and see what occurs.