title: Simple increment/decrement counter
body: <p>I would like to make a simple counter in PowerShell. It must prompt the user whether they'd like a higher or lower number.</p>
  
  <p>The starting number must be 0, and it can't be lower than zero or higher than 10. If the user wants a higher number, it must increment the number with 1, if lower decrement by 1. Then it must be able to stop at the desired number. With this number I can set a registry value.</p>
  
  <p>I don't know an efficient way to prompt the user. I can use the <a href="http://technet.microsoft.com/en-us/library/hh849945.aspx" rel="nofollow noreferrer">Read-Host</a> cmdlet to ask if they typed "higher" or "lower", but is there a more efficient way to accomplish this?</p>
  
  <p>For example,</p>
  
  <pre><code>$i = 0
  
  while (($i -gt 0) -or ($i -lt 10)){
      $j = Read-Host "The current number is $i, would you like a higher/lower number, or quit?"
  
      if ($j -eq "higher") {
          $i++
          Write-Host "The current number is $i"
      } elseif ($j -eq "lower") {
          $i--
          Write-Host "The current number is $i"
      } elseif ($j -eq "quit") {
          Write-Host "Final number is: $i"
          break
      }
  }
  </code></pre>
  
  <p>How can I do this?</p>