Quantcast
Channel: PowerShell
Viewing all articles
Browse latest Browse all 15370

If/Else Statement stops ForEach from looping

$
0
0

Like most of my PowerShell questions this is probably some errant parenthesis or missing fundamental stemming from ignorance, but that's how you learn I guess.

I have a script that takes a CSV file of user data and manipulates it by column then spits out another CSV with the info that I need - pretty mundane and working fine. I have another set of data I need to start adding in however where not all of the users have an email address populated. I can use the existing information from their name to put an email address in, but now that I've added an if/else statement to perform those steps for those lines that don't have a populated email address it will only output the first line of data and the ForEach doesn't kick in to process the other lines of data.

Like I said, I'm probably just not putting parentheses or braces where I should, but...


Viewing all articles
Browse latest Browse all 15370

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>