title: Removing path and extension from filename in PowerShell
body: <p>I have a series of strings which are full paths to files.  I'd like to save just the filename, without the file extension and the leading path.  So from this:</p>
  <pre><code>c:\temp\myfile.txt
  </code></pre>
  <p>to</p>
  <pre><code>myfile
  </code></pre>
  <p>I'm not actually iterating through a directory, in which case something like PowerShell's <code>basename</code> property could be used, but rather I'm dealing with strings alone.</p>