title: Powershell: Move file from one directory to another, based on string within file
body: <p>Looking around the site and can't seem to find some answers for myself. </p>
  
  <p>I'm looking to write a script, that will enable me to move files from one destination to another, based on the contents within the file. </p>
  
  <p>To get into Specifics</p>
  
  <p>Source Destination - V:\SW\FromSite
  Copy to Destination - V:\SW\ToSW
  FileType - .txt
  String - test</p>
  
  <p>Ideally I'd also like to <strong>ONLY</strong> have the script search files that begin with 7. These are unique identifiers to a region.</p>
  
  <p>Pulling my hair out a bit trying.</p>
  
  <p>I was using the below, which runs without error, but does nothing. </p>
  
  <pre><code>$DestDir = "V:\SW\FromSite"
  $SrcDir = "V:\SW\ToSW"
  $SearchString = "test"
  
  gci $SrcDir -filter 7*.txt | select-string $SearchString | select path | 
  move-item -dest $DestDir -whatif
  </code></pre>