Powershell This topic contains 2 replies, has 2 voices, and was last updated by Akshay Salunke 2 years, 11 months ago. Author Posts July 21, 2015 at 3:01 am #27707 Akshay SalunkeParticipant How can we add columns to csv and update only first row of the same csv file? July 21, 2015 at 3:53 am #27713 Rob SimmersParticipant You would actually Import the CSV, update the object, and then export the csv. If we had a csv with the following data: Age Name --- ---- 22 John 21 Sue We want to get the CSV and select only the first line, add a property for Computername and then export the csv: $myCsv = Import-CSV C:\Temp\mycsv.csv | Select -First 1 $myCsv | Add-Member -MemberType NoteProperty -Name ComputerName -Value $env:COMPUTERNAME $myCsv | Export-CSV -Path C:\temp\mycsv.csv -NoTypeInformation Now your CSV would look like this: Age Name ComputerName --- ---- ------------ 22 John LENOVOY50-ROB Keep in mind that there are many ways to do things, so with the limited information you are providing, this would work. July 21, 2015 at 4:39 am #27718 Akshay SalunkeParticipant Thank you Rob. It worked. Author Posts You must be logged in to reply to this topic.