title: How to start a script at a specified point in Powershell
body: <p>I have a powershell script I want to be able to define different starting points for.  Once the starting point is hit the script would pick up from that point and continue through the remaining code in the script.   I don't believe that a case statement will work since I don't think that will just let the script flow through from whatever starting point is defined.  </p>
  
  <p>I would expect to see something like this when the script was started.</p>
  
  <p>Please choose your starting point:</p>
  
  <ol>
  <li>Beginning</li>
  <li>Start at step 2</li>
  <li>Start at step 3 etc.....</li>
  </ol>
  
  <p>When the selection is made the script jumps to that point then will run through the remainder of the script.</p>
  
  <p>Answer:  The code is going to end up looking something like this:</p>
  
  <pre><code>#steps
  $stepChoice = read-host 'Where would you like to start.'
  
  switch($stepChoice)
  {
      1{Step1}
      2{Step2}
      3{Step3}
  
  }
  
  function Step1 { 
      'Step 1' 
      Step2 
  } 
  function Step2 { 
      'Step 2' 
      Step3 
  } 
  function Step3 { 
      'Step 3' 
      'Done!' 
  }
  </code></pre>
  
  <p>Thanks for your help</p>