Hello, I am trying to write a script to do something with user names that is entered in at the input.
$users = @() Do {$users += Read-Host "What is the username: "} until ($users -eq "")
I have that code so far, but the problem is, it doesn't exit until I hit 'ENTER' three times (so it gives 2 null values until it exits).
I viewed this thread: http://social.technet.microsoft.com/Forums/en-US/winserverpowershell/thread/cfb361d2-0868-414a-9b9c-6342df4437b1 , but I don't really understand the TRY/CATCH statement that's in there (that's marked as the answer) and if it's even needed for my use.
Thanks!