title: How to define a subroutine in PowerShell
body: <p>In C# a <code>RemoveAllFilesByExtenstion</code> subroutine could be, for example, decleard like this:</p>
  
  <pre><code>void RemoveAllFilesByExtenstion(string targetFolderPath, string ext)
  {
  ...
  }
  </code></pre>
  
  <p>and used like:</p>
  
  <pre><code>RemoveAllFilesByExtenstion("C:\Logs\", ".log");
  </code></pre>
  
  <p>How can I defne and call a subroutine with the same signature from a PowerShell script file (ps1)?</p>