I'm working on a PS script that will allow a user to paste a bunch of emails on the command line, then the script will parse each one out and run another function on them.
I've looked around for a solution as well as played around in VS Code, but nothing seems to work how I would like it.
The format of the pasted emails by the user will be as follows, copied from a txt file:
1@mail.com
2@mail.com
3@mail.com
Each email separated by a newline.
Using Read-Host, if I paste multiple lines, it just takes the first line, runs whatever function I have on it, then errors out on the next lines.
Essentially I'd like input/output to look like this:
Paste emails:
1@mail.com
2@mail.com
3@mail.com
Operation was performed on email 1@mail.com
Operation was performed on email 2@mail.com
Operation was performed on email 3@mail.com
Any help would be much appreciated. Thank you!