title: How to read JSON data from Powershell script and iterate through it
body: <p>I'm starting to learn Powershell and I'm currently trying to read in a JSON file. </p>
  
  <p>Here is my JSON file (named 'versions.json'):</p>
  
  <pre><code>{
      "versions": {
          "1.0.0": {
              "Component1": "1.0.0",
              "Component2": "1.0.0",
              "Component3": "1.0.0",
          },
          "2.0.0": {
              "Component1": "2.0.0",
              "Component2": "2.0.0",
              "Component3": "2.0.0"
          }
      }
  }
  </code></pre>
  
  <p>I would like to read in this JSON file and print out the versions and what they consist of. For example, 1.0.0 consists of Component 1 at 1.0.0, Component 2 at 1.0.0, and Component 3 at 1.0.0. </p>
  
  <p>I'm currently reading in the JSON file with this Powershell line:</p>
  
  <pre><code>$json = (Get-Content "versions.json" -Raw) | ConvertFrom-Json
  </code></pre>
  
  <p>Now, I want to iterate through $json and print out its data. I'm currently using this:</p>
  
  <pre><code>foreach($v in $json.versions) {
      echo "Data: $v"
  }
  </code></pre>
  
  <p>But, when I run my Powershell script, it prints:</p>
  
  <pre><code>Data: @{1.0.0=; 2.0.0=}
  </code></pre>
  
  <p>Is this the proper output? I was expecting to at least see two entries for 1.0.0 and 2.0.0. This feels like it may be a syntax issue but I am unsure. I am using Powershell version 5. </p>