title: How to return to user menu at the end of a function in PowerShell
body: <p>I am writing a PowerShell script that gives the user a number of options to select from. Once an option is selected, a function is executed and the user is returned back to the original menu.</p>
  
  <p>In the code below, the user is given the options, and the functions are executed, but when complete, the script just ends. What I want instead is at the end of the function to return to the original user menu. Can someone tell me how to do this? Thanks!</p>
  
  <pre><code>function firstFunction {
      Write-Host "You chose option 1"
      return
  }
  
  Write-Host "Welcome"
  
  [int]$userMenuChoice = 0
  while ( $userMenuChoice -lt 1 -or $userMenuChoice -gt 4){
      Write-Host "1. Menu Option 1"
      Write-Host "2. Menu Option 2"
      Write-Host "3. Menu Option 3"
      Write-Host "4. Quit and Exit"
  
  [int]$userMenuChoice = Read-Host "Please choose an option"}
  switch ($userMenuChoice) {
      1{firstFunction}
      2{Write-Host "You chose option 2"}
      3{Write-Host "You chose option 3"}
  default {Write-Host "Nothing selected"}
  }
  </code></pre>