title: How can I get the current directory with correct spelling?
body: <p>I can get the path of the current directory using <code>GetCurrentDirectory()</code> but it always seems to inherit the spelling of PowerShell's current directory. For example, let's suppose I have a directory structure named <code>Test\MyProgram</code> on volume <code>D:</code>. Now if I do this in PowerShell:</p>
  
  <pre><code> cd D:/test/myprogram
   ./myprogram
  </code></pre>
  
  <p>Then <code>GetCurrentDirectory()</code> will return <code>D:\test\myprogram</code> as the current directory because that's what I passed to <code>cd</code> but as described above, it is <code>D:\Test\MyProgram</code> in reality. </p>
  
  <p>Of course, upper and lower case characters don't make a difference on Windows, but still: How can I get the real name of the current directory, with the correct spelling? </p>