title: Powershell 1.0 - Renaming files fails when script is in a different directory
body: <p>I am trying to batch rename old log files, but the script only works for me when the script is stored in the same folder as the log files.  Here is the code:</p>
  
  <pre><code>cls
  $file = gci E:\logs |? {$_.extension -eq ".log" |% {rename-item $_ ($_.Name + ".old")}
  </code></pre>
  
  <p>When I run this script from <code>E:\logs</code>, it works just fine.  However, when I run this script from C:\Scripts, it gives me this error:</p>
  
  <pre><code>Rename-Item: Cannot rename because item at 'my.log.file.log' does not exist.
  At C:\Scripts\rename-script.ps1:2 char:92
  + $file = gci E:\logs |? {$_.extension -eq ".log" |% {rename-item $_ ($_.Name + ".old")}
      + CategoryInfo          : InvalidOperation (:) [Rename-Item], FSInvalidOperationException
      + FullyQualifiedErrorId : InvalidOperation,Microsoft.PowerShell.Commands.RenameItemCommand
  </code></pre>
  
  <p>I also tried using the <code>Move-Item</code> command with the <code>-literalpath</code> switch but had the same result</p>