Good morning guys,
I have a simple REST API call that returns XML but for the life of me I can't figure out why the file is coming back empty.
My code:
$key = "&key=b8dedadf7bf2554b636XXXXXXXa42a27affd2a" $filter = "?status_id=1" $url = "http://server:3000/redmine/users.xml" + $filter + $key Invoke-RestMethod $url | out-file "T:\temp\test.xml"
When I run it the file will just contain:
xml users --- ----- version="1.0" encoding="UTF-8" users
But no other information.
If I issue the REST call into the browser directly, I get nice clean XML response with all the information I need.
Obviously I am doing something wrong in Powershell but I can't figure it out!