Already saw this url: How to read the first column of a CSV file with powershell That said what I'm trying to accomplish is from a CSV file that contains 2 columns. I need to read the first column's value and mail to second column CSV Example
| Item | |
|---|---|
| A300 | bob@gg.com |
| B600 | loco@dd.com |
$check_date = Get-Date -Format "MM-dd-yyyy"
$csv = Import-Csv C:\stores_TEST.csv
ForEach($line in $csv)
{$ColumnName = $csv[0].PSObject.Properties.Name[0]
$MailSubject = "Report - "+$csv.$ColumnName+" - "+$check_date
}
I can either get the ITEM to show up; example Report - 2030 2098 2134 2247 2337 3243 7126 2140 OR in try 2 I can get Report - ITEM - 08-03-2022 . But I want Report - A300 - 08-03-2022. Thanks for help in advance.