powershell Read-host does not stop for input
- by llirik42
I thought this would be fairly basic, but i'm stuck.
I have 3 lines of powershell script in which I want to collect a mailbox name from user input, then create names based on that mailbox name. (later the script proceeds to create the groups in AD, etc)
my problem is that when I run all 3 of these lines by pasting them into powershell window, I don't get a change to enter the response to read-host. Instead the script just scrolls through to the next line and uses it as the response for the Read-Host
here's the powershell:
$name = read-host "enter group name"
$groupfull = ($name+'.Full'a)
$groupsendas = ($name+'.SendAs')
Here's the output:
PS C:\Users\kg> $name = read-host "enter group name"
enter group name: $groupfull = ($name+'.Full')
PS C:\Users\kg> $groupsendas = ($name+'.SendAs')
PS C:\Users\kg>
Thanks in advance