title: Powershell find and move file
body: <p>I have a long list of find and move operations, I want to slim down the script by substituting the following 2 long commands with 2 short variables.</p>
  <p>Short variables:</p>
  <pre><code>$f = 'Get-ChildItem -Recurse -Filter'
  $m = 'Move-Item -Force -Verbose -Destination V:\MSL\_pdf\'
  </code></pre>
  <p>Long commands:</p>
  <pre><code>Get-ChildItem -Recurse -Filter GAS*.pdf | Move-Item -Force -Verbose -Destination V:\MSL\_pdf\GAS
  Get-ChildItem -Recurse -Filter GCA_00*.pdf | Move-Item -Force -Verbose -Destination V:\MSL\_pdf\GCA\GCA_00
  Get-ChildItem -Recurse -Filter GCA_01*.pdf | Move-Item -Force -Verbose -Destination V:\MSL\_pdf\GCA\GCA_01
  </code></pre>
  <p>And this doesn't work:</p>
  <pre><code>$f GAS*.pdf | $m`GAS
  $f GCA_00*.pdf | $m`GCA\GCA_00
  $f GCA_01*.pdf | $m`GCA\GCA_01
  </code></pre>