I need to create a new CSV from an existing table, but I need to add a column before and have no headers, or quotes around the data within the cells. I noticed if I open the file, save it, quotes are removed but this file will be going external at 1AM nightly Example Example in Windows Explorer
$NewCSV = '\\server2\export.csv'
$Assets = (import-csv '\\server1\PCList.csv' | Where-Object {$_.PCNumber -ne ''}).PCnumber | ForEach-Object {
[pscustomobject]@{
'h1' = 'IT Support'
'h2' = $_+'.acme.net'
}
} | Export-Csv $NewCSV
I have seen usage of Outfile but that breaks my columns