Windows Powershell Rename Column Heading CSV file
You may use Select-Object
with a calculated property to do this.
Import-Csv test.csv |
Select-Object @{ expression={$_.first_name}; label='test' } |
Export-Csv -NoTypeInformation test1.csv
Can't you try something like :
import-csv 'c:\tmp\test.csv' | select -Property @{name="test";expression={$($_.first_name)}}| Export-Csv c:\tmp\test1.csv