Hi,
I have the following code
$b = Import-CSV -Path "\\server\Shared_Documents\FC Folder\Despatch\Brexit Files\Palletinfo\DHL\DHL 26-01-2021.csv" -Delimiter ","
$b | Add-Member -MemberType NoteProperty -Name 'id' -Value $null
$b | Add-Member -MemberType NoteProperty -Name 'Date_upload' -Value (get-date).ToString("dd-MM-yyyy")
$b | Export-Csv "\\server\Shared_Documents\FC Folder\Despatch\Brexit Files\Palletinfo\DHL\DHL 26-01-20211.csv" -NoTypeInformation
#$ImportFile = "\\server\Shared_Documents\FC Folder\Despatch\Brexit Files\Palletinfo\DHL "+$today+".csv"
Write-Host –NoNewLine $b
Which add two new columns called id and date_upload.
This works, the problem is that it adds it to the end of the file. I am wanting to add id to beginning and Date_upload to the end of the column list.
How would I go about doing that? Any help appreciated.