none
Powershell Invoke-RestMethod Error RRS feed

  • Question

  • I am testing querying Bing Maps REST Service via the invoke-RestMethod powershell cmdlet, but I get the following output:

    authenticationResultCode : ValidCredentials
    brandLogoUri             : dev.virtualearth.net/Branding/logo_powered_by.png
    copyright                : Copyright © 2013 Microsoft and its suppliers. All rights reserved. This API cannot be accessed and the content and any results may not be used,
                               reproduced or transmitted in any manner without express written permission from Microsoft Corporation.
    resourceSets             : {{estimatedTotal=1; resources=System.Object[]}}
    statusCode               : 200
    statusDescription        : OK
    traceId                  : ef358facbd20465c85f983d9f35208c8|MIAM001452|02.00.183.2300|MIAMSNVM001367, MIAIPEVM000037

    The query was:

    Invoke-RestMethod -URI "dev.virtualearth.net/REST/v1/Locations?query=22%20Lansdowne%20Lane%20Palm%20Coast,%20FL%2032137&include=queryParse&o=json&key=BingKey" -ContentType application/json -Method Get

    where the BingKey is my application key.  Also, the URI is prefixed with HTTP://.   This posting didn't allow me to include a link.

    Is invoking the REST API via PowerShell not supported?

    Thanks!

    Dom Vila

    Tuesday, December 17, 2013 10:19 PM

Answers

  • It worked. The result you are looking for is buried in the resourceSets value. That I an array objects that contain an array of results. You just need to dive into that value more to get your details.

    http://rbrundritt.wordpress.com

    Wednesday, December 18, 2013 8:58 AM