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             :
    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||MIAMSNVM001367, MIAIPEVM000037

    The query was:

    Invoke-RestMethod -URI ",%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?


    Dom Vila

    Tuesday, December 17, 2013 10:19 PM


  • 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.

    Wednesday, December 18, 2013 8:58 AM