Your data. Anywhere you go.

New Relic for iOS or Android


Download on the App Store    Android App on Google play


New Relic Insights App for iOS


Download on the App Store


Learn more

Close icon

New Relic API call from windows powershell v5.1.*

api

#1

I am trying to run below curl command in windows Powershell 5.1.* to get an xml response for below API. I am receiving error when trying to add metrics detail as below using -i -g -d ‘*****’. Could you please help what is missing here if I have to run this API command on windows Powershell?

curl -uri https://api.newrelic.com/v2/applications/19050618.xml -Headers @{“x-api-key”=“secretkey”} -ContentType “application/xml” -i -G -d ‘names[]=EndUser&from=2018-0
9-21T15:35:00+00:00&to=2018-09-21T16:35:00+00:00&summarize=true’


#2

Hi, @ABhagyanathan: In PowerShell, curl is an alias for Invoke-WebRequest . You will have to replace the curl switches (-i -G -d) with the Invoke-WebRequest equivalents.