title: Convert Invoke-RestMethod output to object
body: <p>I'm trying to use PowerShell <code>Invoke-RestMethod</code> on a ticketing system's API and then convert the output into a PowerShell object.</p>
  
  <p>As an example when I use <code>Invoke-RestMethod</code> to get the properties of a ticket I get this.</p>
  
  <pre><code>$object = Invoke-RestMethod '[URI here]'
  $object.GetType()
  
  IsPublic IsSerial Name                                     BaseType
  -------- -------- ----                                     --------
  True     True     String                                   System.Object
  
  
  $object
  
  EWREST_supported_user0='Yes';
  EWREST_updater_team='Support Team';
  EWREST_eng_id='CLT';
  EWREST_testlabelsub='Test Label';
  EWREST_time_created='17:21:03';
  EWREST_cr_conversion_related_to='Support Case';
  EWREST__1901_full_name='secuser Testuser1';
  EWREST_summary='Ticket Title';
  EWREST_i_would_like_to_reopen_my_ticket='No';
  EWREST_assigned_team_leader='Agiloft Admin';
  EWREST_id='183255';
  EWREST_severity='Sev 4';
  EWREST_problem_description='&lt;div&gt;This is an example of a ticket note that takes up multiple lines when read via API&lt;\/div&gt;&lt;div&gt;&amp;nbsp;&lt;\/div&gt;&lt;div&gt;Example note info here&lt;\/div&gt;&lt;div&gt;&amp;nbsp;&lt;\/div&gt;
  &lt;div&gt;Additional example note info here&lt;\/div&gt;&lt;div&gt;&amp;nbsp;&lt;\/div&gt;&lt;div&gt;Even more note info here&lt;\/div&gt;';
  EWREST_demo_data='No';
  </code></pre>
  
  <p>What I would like to be able to do is manipulate <code>$object</code> as an object by doing things like <code>$object.EWREST_category</code> and get "Networking".  So I have been trying to figure out how to maniuplate <code>$object</code> which is just a string of attributes to a traditional PowerShell object with properties.</p>
  
  <p>Can someone offer some pointers on how to go about that?</p>