title: Extract data from json file throush "powershell" command
body: <p>I am trying to get data from my <code>json</code> file but my code is still not working. Do you have any suggestion ? </p>
  
  <p>JSON file :</p>
  
  <pre><code>  "nodes": [
  
      {
  
        "id": "elfe",
  
        "apps": [
  
          {
  
            "id": "man1",
  
            "age" = "5"
  
            "power" ="strenght"
  
          },
  
          {
  
            "id": "man2",
  
            "age" = "10"
  
            "power" ="strenght"
  
          }],
  
        "id": "monster",
  
  
        "apps": [
  
          {
  
            "id": "man3",
  
            "age" = "5"
  
            "power" ="strenght"
  
          },
  
          {
  
            "id": "man4",
  
            "age" = "10"
  
            "power" ="strenght"
  
          }],
  </code></pre>
  
  <p>And there, my code in PowerShell. I just want to get <code>man1</code>, <code>man2</code>, <code>man3</code>, <code>man4</code> values in my file for each <code>id</code> elfe and monster like that :</p>
  
  <pre><code>man1
  man2 
  </code></pre>
  
  <p>in one file and in the other file:</p>
  
  <pre><code>man3
  man4
  </code></pre>
  
  <p>My batch script : </p>
  
  <pre><code>Powershell -Nop -C "(Get-Content .\config.json |ConvertFrom-Json).Nodes | Select-Object -ExpandProperty id | Where-Object id -eq elfe" &gt;&gt; file.txt
  </code></pre>
  
  <p>EDIT : I can't modify my JSON file... </p>