title: Is there a PowerShell equivalent for Python's doctest module?
body: <p>I've just come across the <code>doctest</code> module in Python, which helps you perform automated testing against example code that's embedded within Python doc-strings. This ultimately helps ensure consistency between the documentation for a Python module, and the module's actual behavior.</p>
  
  <p>Is there an equivalent capability in PowerShell, so I can test examples in the <code>.EXAMPLE</code> sections of PowerShell's built-in help?</p>
  
  <p>This is an example of what I would be trying to do:</p>
  
  <pre><code>function MyFunction ($x, $y) {
      &lt;#
      .EXAMPLE
  
      &gt; MyFunction -x 2 -y 2
      4
      #&gt;
      return $x + $y
  }
  
  MyFunction -x 2 -y 2
  </code></pre>