title: Get values from JSON with Powershell
body: <p>Very beginner question. I'm trying to get certain values from JSON with Powershell.. Specifically, I want to list the Services: <strong>TEST00000</strong> and <strong>FAKE</strong> only.</p>
  
  <p>When I run the script below, I get this:</p>
  
  <pre><code>TEST00000                                                    FAKE           
  ---------                                                    ----           
  @{Enabled=True; Processed=2; Sent=3; Failed=4; Downloaded=5} @{Enabled=True}
  </code></pre>
  
  <p>How can I get a list of only the services?</p>
  
  <p>More importantly, how do I list only the services which has the key/value <em>Enabled=True</em> present inside of them?</p>
  
  <p>Here is the code:</p>
  
  <pre><code>$JSON = '{
    "Envs": {
      "DEV": {
        "Services": {
          "TEST00000": {
            "Enabled": true,
            "Processed": 2,
            "Sent": 3,
            "Failed": 4,
            "Downloaded": 5
          },
          "FAKE": {
            "Enabled": true
          }
        }
      }
    },
    "Component": {
      "Digger": {
        "Envs": {
          "DEV": {
            "DownloadE": 4
          }
        }
      }
    }
  }'
  
  $jsonobj = ConvertFrom-Json -inputObject $JSON
  
  $jsonobj.Envs.DEV.Services
  </code></pre>