Exit from script

by Jul 31, 2013

Hi,

In my script there is a possibility to exit, but it does not… could you give me a hint? when I choose "Would you like to run again? (Y/N)" N is not working…

$choice = ""
$run = "YES"
$response = ""

While ($run -ne "No") {
$response = Read-Host "Please, enter the sevice first letter+*: "
get-service $response | where-object {$_.Status -eq "running"}

$choice = Read-Host " Would you like to run again? (Y/N) "
    if (($choice -ne "Y") -and ($choice -ne "N"))  {
    $choice = ""

    }
    }

    if ($choice -eq "Y") {
    $response = ""
    }
  else {  
  $run = "No"
  }