0

The following command works in Ubuntu box:

curl -X GET "https://panorama.domain.com/api/?key=LUFRPTxxxxx&type=commit&action=partial&cmd=<commit><partial><admin><member>USERNAME</member></admin></partial></commit>

but it doesn't in the same box under powershell as:

Invoke-RestMethod -Method GET -Uri 'https://panorama.domain.com/api/?key=LUFRPTxxx&type=commit&action=partial&cmd=<commit><partial><admin><member>USERNAME</member></admin></partial></commit>' -Verbose:$true

I get:

VERBOSE: GET with 0-byte payload
VERBOSE: received 97-byte response of content type application/xml
Invoke-RestMethod: Invalid Credential

What am i doing wrong here? Do i have to split everything after api ?

Alex
  • 75
  • 7
  • What will be in output if you try `(Invoke-WebRequest -Uri "https://panorama.domain.com/api/?key=LUFRPTxxxxx&type=commit&action=partial&cmd=USERNAME").Content` ? – Alex R. Jul 01 '22 at 09:30
  • No content, as the response is: `Invalid credentials`. It doesn't even authenticate. I believe it's the way the URI is constructed. – Alex Jul 01 '22 at 09:46
  • If i run the curl command, the response is: `The result of this commit would be the same as the previous commit queued/processed. No edits have been made between these subsequent commits. Please check the previous commit status. If still needed, use commit force instead. `. I expect something similar to this in Invoke PS – Alex Jul 01 '22 at 09:47

0 Answers0