I want to add time and date row at the end of each entry in the csv file. I am only able to add time and date at the end of the database not to each row
Powershell
import-csv C:\Users\system\Desktop\WindowsUpdate1.csv |
foreach-object {
$row = $_
$row | add-member NoteProperty "Time" (Get-Date -format t)
$row
}
I only get one column in regard to the date and time instead of getting it in every row.
Select-Object.Select-Objectwith calculated properties would be a better solution, as @Lee_Dailey notes, your code looks fine and should successfully add a.Timeproperty to each input object (row).