title: How to load a JSON file and convert it to an object of a specific type?
body: <p>I have a type <code>FooObject</code> and I have a JSON file which was serialized from a <code>FooObject</code> instance. Now I want to use <code>ConvertFrom-Json</code> to load the JSON file to memory and covert the output of the command to a <code>FooObject</code> object, and then use the new object in a cmdlet <code>Set-Bar</code> which only accept <code>FooObject</code> as the parameter type.</p>
  
  <p>But I notice that the output type of <code>ConvertFrom-Json</code> is <code>PSCustomObject</code> and I did not find any way to convert <code>PSCustomObject</code> to <code>FooObject</code>.</p>