title: Remove JSON object properties that match regular expression in PowerShell
body: <p>Given an example json object like:</p>
  
  <pre><code>{
    "Id": 1,
    "Name": "Pablo",
    "UnwantedProperty1XOXO": true,
    "UnwantedProperty2XOXO": false,
    ...
  }
  </code></pre>
  
  <p>I want to remove every property that ends in <code>XOXO</code> (so the regex would be something like <code>/.+XOXO$</code>).</p>
  
  <p><strong>How can I remove all the properties with names that match a regular expression with PowerShell?</strong> (either with a JSON object or PowerShell object)</p>
  
  <p>I can remove properties from a PowerShell object like this but it doesn't seem to work with a regular expressions:
  <code>$myObject.PSObject.Properties.Remove("someProperty")</code></p>