JSON-Response with numeric "keys"

Welcome Forums General PowerShell Q&A JSON-Response with numeric "keys"

This topic contains 1 reply, has 1 voice, and was last updated by

 
Participant
2 years, 3 months ago.

  • Author
    Posts
  • #54792

    Participant
    Points: 0
    Rank: Member

    hi!
    i am getting the following Json-Response and pipe it to this Export-CliXml Result. i then use 'Get-Content' to read that file and find the 'edittoken'-line like this.

    does anybody have an idea how this could be done without the workaround of making use of 'Export-CliXml'?

    the problem (as far as i understand it) is that PowerShell can not handle/work with the numeric object as "$WebRequestObject.query.pages.338" fails.

    KR
    Guenther

  • #54832

    Participant
    Points: 0
    Rank: Member

    found a solution using the function "ConvertTo-HashtableFromPsCustomObject" from this blog entry:
    https://blogs.msdn.microsoft.com/timid/2013/03/05/converting-pscustomobject-tofrom-hashtables/

    KR
    Guenther

The topic ‘JSON-Response with numeric "keys"’ is closed to new replies.