title: Powershell dynamic <tab> completion
body: <blockquote>
    <p>^ before voting to close, understand that the "answer" to the above question is to use another module, not how to implement it yourself.</p>
  </blockquote>
  
  <p>I have a set of powershell modules that I use to help me with my git workflow (think <a href="https://github.com/nvie/gitflow" rel="nofollow">gitflow</a>).</p>
  
  <p>Here's an example.</p>
  
  <pre><code>Function Merge-FromBranch([string] $branch){
      # ...
  }
  
  Set-Alias mfb Merge-FromBranch
  </code></pre>
  
  <p>I would like to be able to have tab completion for the branch name using branches that exist in the repo.</p>
  
  <p>Now getting the local branch names is easy</p>
  
  <pre><code>&gt; git branch
  </code></pre>
  
  <p>but what I need to be able to do is</p>
  
  <pre><code>&gt; mfb fea&lt;tab&gt;
  </code></pre>
  
  <p>in order to tab through the feature branches.</p>
  
  <p>How can I wire it up so that I can tab complete the <code>$branch</code> parameter on my module?</p>
  
  <p>I know I can pipe the <code>git branch</code> output to another method (<code>git branch | do-stuff</code>), but I don't know how to integrate it into tab completion of a module.</p>