
#Import the CSV file data into Variable and add the blank new ID column $CSV = import-csv “D:\Temp File\Temp.csv” | select Employee_ID, @{Name=”Id”;Expression={$_.””}} # so we start from ID = 1 in the CSV file $x=1; # this will loop each row in CSV and insert the incremental unique ID value FOREACH($ReadData in $CSV) {$ReadData.Id=$x;$x++}