The article provides an example of using the Import-csv command in PowerShell.

Sample CSV Structure:

1
2
#ServeurName;Ipstart;IpEnd;Description
#Repli.leblogosd.lan;192.168.0.1;192.168.0.254;ServeurLab

Script example

1
2
3
4
5
6
7
$CSVs = Import-Csv $PreferedServerCSV -Delimiter ";"
foreach ($CSV in $CSVs) {
  $Serveur       = $CSV.ServeurName
  $Ipdebut       = $CSV.Ipstart
  $IpFin         = $CSV.IpEnd
  $Description   = $CSV.Description
}

0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.