en:powershell:start
                Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| en:powershell:start [2021/03/09 22:39] – lonclegr | en:powershell:start [2021/03/16 21:48] (current) – lonclegr | ||
|---|---|---|---|
| Line 3: | Line 3: | ||
| ===== Basics ===== | ===== Basics ===== | ||
| - | According to me, the first thing we need to deal with is CSV file. First let's read one CSV file, loop over it. | + | To me, the first thing we need to learn is to deal with is CSV file. First let's read a CSV file, loop across the lines. | 
| Here is an example of CSV input file. | Here is an example of CSV input file. | ||
| Line 25: | Line 25: | ||
| Import-Csv -Path input.csv | foreach { | Import-Csv -Path input.csv | foreach { | ||
| - | # save current object into different | + | # save current object into a local variable | 
| $currentLine = $_ | $currentLine = $_ | ||
| Line 31: | Line 31: | ||
| $mail = $currentLine.Mail | $mail = $currentLine.Mail | ||
| - | # test domain | + | # test mail domain name | 
| # we add a property with the result of our test | # we add a property with the result of our test | ||
| if ($mail -match " | if ($mail -match " | ||
| Line 54: | Line 54: | ||
| " | " | ||
| </ | </ | ||
| + | |||
| + | <csv> | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | </ | ||
en/powershell/start.1615347551.txt.gz · Last modified:  by lonclegr
                
                