I have a fairly standard csv file with headers I want to add a new column & set all the rows to the same data.
column1, column2
1,b
2
Here's one way to do that using Calculated Properties:
Import-Csv file.csv |
Select-Object *,@{Name='column3';Expression={'setvalue'}} |
Export-Csv file.csv -NoTypeInformation
You can find more on calculated properties here: http://technet.microsoft.com/en-us/library/ff730948.aspx.
In a nutshell, you import the file, pipe the content to the Select-Object cmdlet, select all exiting properties (e.g '*') then add a new one.