0

I converted a plain text inside note-pad to JSON file using this command ConvertTo-Json; so how do I get the specific key value that equivalents to note-pad text content?

    get-content -Path c:\Users\ayyub\oneDrive\Desktop\Jayson.txt | ConvertTo- 
    Json  
1

1 Answer 1

2

Let's say your .json looks like this:

{
    "person": {
        "kevin": {
            "phone": "00000099999"
        }
    }
}

After converting the .txt to a .json you can probably try this:

$json = (Get-Content "example.json" -Raw) | ConvertFrom-Json

$json.person.kevin.phone
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.