title: Access PSObject property by name in C#
body: <p>For example I have a PSObject transaction with two properties: id and transactionName , so that it looks like:
  transaction {
      id: 123
      transactionName : tranName1
  }</p>
  
  <p>and I want to return the id of the transaction if its name is tranName1. </p>
  
  <p>It looks to me that in powershell scripts, we can simply do:</p>
  
  <pre><code>if $transaction.transactionName -eq tranName return $transaction.id
  </code></pre>
  
  <p>however in c# it will give error since it cannot recognize the property by name... any ideas how to do it in c#?</p>