title: Powershell: subtract $pwd from $file.Fullname
body: <p>Given the following files:</p>
  
  <pre><code>c:\dev\deploy\file1.txt
  c:\dev\deploy\file2.txt
  c:\dev\deploy\file3.txt
  c:\dev\deploy\lib\do1.dll
  c:\dev\deploy\lib\do2.dll
  </code></pre>
  
  <p>e.g. if $pwd is the following</p>
  
  <pre><code>c:\dev\deploy
  </code></pre>
  
  <p>running the statement</p>
  
  <pre><code>$files = get-childitem
  </code></pre>
  
  <p>I want to take this list and using <code>foreach ($file in $files)</code> I want to substitute my own path for the <code>$pwd</code> e.g. I want to print <code>c:\temp\files</code> like the following:</p>
  
  <pre><code>c:\temp\files\file1.txt
  c:\temp\files\file2.txt
  c:\temp\files\file3.txt
  c:\temp\files\lib\do1.dll
  c:\temp\files\lib\do2.dll
  </code></pre>
  
  <p>How can I peform this i.e.</p>
  
  <pre><code>A = c:\dev\deploy\file1.txt - c:\dev\deploy\
  B = c:\temp\files\ + A
  
  giving B = c:\temp\files\file1.txt
  </code></pre>
  
  <p>?</p>