I have the code below where it grabs info from a CSV file. The problem is that, not everyone have a title, or a desk phone, or a cell phone. I’m able to write if title is NULL, don’t read at line. This is working.
I was wondering if there’s a way in PowerShell to tell it if any of these (Name, Title, Street, etc) is NULL, don’t read that line?
If you’re using Import-CSV, then each row is an object. Assuming you’re enumerating the rows and using a variable like $row (since you didn’t post that part, I can only provide a basic example) I’d probably do something like…
if ($row.website -and $row.name -and $row.title) {