Convert String to Object in PowerShell

Viewed 510

I get a string from a Web-Request and I want to get a specific value from this response. The string of the response looks like:

[
    "BeginOfEnumerable",
    [
        {
            "Classification": [
                "/",
                "/Document/",
                "/Document/Engineering-Document/"
            ],
            "FieldValues": {
                "/0": "123456789",
                "/2": "55667788"
            },
            "Key": "urn:key:Document:123456789"
        }
    ],
    "EndOfEnumerable"
]

How do I get the value "123456789" from the line "Key": "urn:key:Document:123456789"? The value has no specific syntax and can look like "12345-XY", "asdfgh", etc. Is there a way to convert the valid Json-String above to an object (Json, HasTable, JArray, ...) and get the wanted value? Or is better to get the value by string-operations like substring etc.?

0 Answers
Related