title: Powershell ConvertFrom-Json error
body: <p>I created one simple PowerShell script <strong>fromJson.ps1</strong> (below):</p>
  
  <pre><code>param([string]$Jstring, [string]$JColumn)
  $val = $Jstring | out-string | ConvertFrom-Json | select $Jcolumn
  $val | format-table -auto
  </code></pre>
  
  <p>Now I am trying to parse some sample JSON using below method but it fails with an "Invalid JSON primitive" error. I am running it directly from a command prompt and calling <strong>powershell.exe</strong>.</p>
  
  <pre><code>c:\powershell&gt;PowerShell.exe ./FromJson.ps1 '{"username":"","uid":"","contextid":8651,"partnerEntID":0}' "contextid"
  </code></pre>
  
  <p>Error :</p>
  
  <pre><code>ConvertFrom-Json : Invalid JSON primitive: . At
  C:\SCRIPTS\PowerShell\FromJson.ps1:2 char:32
  + $val = $Jstring | out-string | ConvertFrom-Json | select $Jcolumn
  +                                ~~~~~~~~~~~~~~~~
      + CategoryInfo          : NotSpecified: (:) [ConvertFrom-Json], ArgumentException
      + FullyQualifiedErrorId : System.ArgumentException,Microsoft.PowerShell.Commands.ConvertFromJsonCommand
  </code></pre>
  
  <p>Though same works absolutely fine if I run it on powershell prompt. </p>
  
  <pre><code>PS C:\PowerShell&gt; ./FromJson.ps1 '{"username":"","uid":"","contextid":8651,"partnerEntID":0}' "contextid"
  </code></pre>
  
  <p>Has someone run into this issue and resolve it ?
  Thanks,
  NJ</p>