title: Powershell - Loop script until user chooses to exit
body: <p>How can I start a script over again?  I have 3 switches and I want them to revert back to the beginning of the script. </p>
  
  <pre><code>Import-Module ActiveDirectory
  Write-Host "--Please Login using a.account--"
  #login
  $credential = Get-Credential
  #Main
  Write-Host "--Remote Computer Rename v2.0--"
  Write-Host "1. Query AD (Outputs to a text file)"
  Write-Host "2. Quick computer rename"
  Write-host "3. Quit"
  $choice=Read-Host "Chose a number to continue"
  
  #AD Query for computer
  switch ($choice)
  {
   1 {
  Write-Host "--Enter first five characters of computer name or full computer name i.e.     USCLT--"
  $cn=Read-Host 'Computer name'
  $out="$cn*"
  Get-ADComputer -Filter 'SamAccountName -like $out' &gt;&gt; c:\myscripts\dsquery.txt
  Write-Host "Query complete.  See dsquery.txt saved to Desktop."
  }
  
  ...rest of my code.
  </code></pre>
  
  <p>So after <em>See dsquery.txt saved to Desktop."</em> I want it to go back to write-host portion.</p>