title: Run a command using PowerShell on each directory with an assumed path component
body: <p>I found <a href="https://stackoverflow.com/questions/784057/run-a-simple-command-using-powershell-recursively-on-a-directory">this question</a>, which is <em>very</em> similar to what I want but I just couldn't get it to work.</p>
  
  <p>I want to run process.exe on each subdirectory's XML directory of C:\ToProcess. If I did it by hand, the first 6 of the 50 or so commands would look like this:</p>
  
  <pre><code>process.exe -switch1 -switch2 -i "C:\ToProcess\abx\XML" -o "C:\Processed\abx\XML"
  process.exe -switch1 -switch2 -i "C:\ToProcess\dez\XML" -o "C:\Processed\dez\XML"
  process.exe -switch1 -switch2 -i "C:\ToProcess\ghm\XML" -o "C:\Processed\ghm\XML"
  process.exe -switch1 -switch2 -i "C:\ToProcess\jkq\XML" -o "C:\Processed\jkq\XML"
  process.exe -switch1 -switch2 -i "C:\ToProcess\mn0\XML" -o "C:\Processed\mn0\XML"
  process.exe -switch1 -switch2 -i "C:\ToProcess\pq2\XML" -o "C:\Processed\pq2\XML"
  </code></pre>
  
  <p>But before running those commands, I would have to do this, because the target folders do not yet exist:</p>
  
  <pre><code>md "C:\Processed\abx"
  md "C:\Processed\dez"
  md "C:\Processed\ghm"
  md "C:\Processed\jkq"
  md "C:\Processed\mn0"
  md "C:\Processed\pq2"
  md "C:\Processed\abx\XML"
  md "C:\Processed\dez\XML"
  md "C:\Processed\ghm\XML"
  md "C:\Processed\jkq\XML"
  md "C:\Processed\mn0\XML"
  md "C:\Processed\pq2\XML"
  </code></pre>
  
  <p>So, is there a way to do all this in just a couple commands?</p>