title: Powershell copy file/folder based on keyword
body: <p>I want to copy folder which match with the keyword. however i want powershell read the keyword from starting point. i added my script below</p>
  <p>if any folder name contain test at the start, script will copy the folder. but it's coping all folder even if &quot;Test&quot; keyword is available in the middle name. like if there is two folder</p>
  <p>&quot;This.is.a.Test.Folder&quot;
  &quot;Test.this.is.a.Folder&quot;</p>
  <p>I want powershell copy only &quot;Test.this.is.a.Folder&quot;</p>
  <p>any help please</p>
  <pre><code>$dest = &quot;D:\2&quot;;
  $include= @(&quot;*Test*&quot;)
  Get-ChildItem $source -recurse -Force -Verbose -include $include | copy-Item -Destination {Join-Path $dest $_.FullName.Substring($source.length)}```
  
  
  </code></pre>