 <p>Since you're using PS3+, instead of joining the lines (it's slow), read the file as one string via <code>-Raw</code>:</p> <pre class="lang-ps prettyprint-override"><code>$content = Get-Content $filepath -Raw | ConvertFrom-Json </code></pre> <ul> <li><p>Filtering by name, showing contents without name:</p> <pre class="lang-ps prettyprint-override"><code>$name = 'Child1' $content.Root.$name | ConvertTo-Json </code></pre> <p>In PS2.0:</p> <pre class="lang-ps prettyprint-override"><code>$content.Root | Select -expand $name | ConvertTo-Json </code></pre></li> <li><p>Filtering by name, showing name and contents:</p> <pre class="lang-ps prettyprint-override"><code>$name = 'Child1' ($content.Root | select $name | ConvertTo-Json) -replace '^.|.$','' </code></pre></li> <li><p>Filtering by <code>Id</code>, showing contents:</p> <pre class="lang-ps prettyprint-override"><code>$content.Root | ForEach { $_.PSObject.Properties.Value | Where Id -eq 2 } | ConvertTo-Json </code></pre></li> <li><p>Filtering by <code>Id</code>, showing name and contents of the node:</p> <pre class="lang-ps prettyprint-override"><code>($content.Root | ForEach { $_.PSObject.Properties | Where { $_.Value.Id -eq 2 } | ForEach { @{$_.Name = $_.Value} } } | ConvertTo-Json ) -replace '^.|.$','' </code></pre></li> </ul>