title: PowerShell Move-Item - Not Moving Files
body: <p>I have a script (pasted below) that's supposed to do the following:</p>
  
  <ol>
  <li>Loops and grabs all files that match a defined pattern</li>
  <li>Copies those files into another location</li>
  <li>Move the original source file into another location (if copy was successful)</li>
  </ol>
  
  <p>It's doing step #1 and #2 but step #3, Move-Item is not moving any files and I don't know why and I get no indication of an error</p>
  
  <p>Can someone help? Thanks</p>
  
  <pre><code>$source = "C:\Users\Tom\"
  $source_move = "C:\Users\Tom\OldLogBackup1\"
  $destination ="C:\Users\Tom\Mirror\"
  
  if(-not(Test-Path $destination)){mkdir $destination | out-null}
  
  
  ForEach ($sourcefile In $(Get-ChildItem $source | Where-Object { $_.Name -match "Daily_Reviews\[\d\d\d\d-\d\d\d\d\].journal" }))
  {
      #escape filename because there are brackets in the name!
  $src = [Management.Automation.WildcardPattern]::Escape($sourcefile)
  Copy-Item  $src $destination
  
  ### Check for a successful file copy
  if($?)
  {
  
      #### 
      if(-not(Test-Path $source_move)){
          echo "Path does not exist!"
      } else { 
          echo "Path exists!"
  
          ### Move original source file someplace else
          Move-Item $source_move$sourcefile $source_move
          if($?)
          {
              echo "Source file successfully moved"
  
          } else {
  
              echo "Source file was not successfully moved"
  
      }
    }
  }
  </code></pre>