I have the following PowerShell code that imports a csv (that has 35 column) and modifies the "Account" column. It's working as expected. However, when I export, it's adding it as the first column when it should be the 7th position.
$Results = Import-Csv "$Env:FILEPATH\Metadata\Booking*.csv" | Select-Object @{Name = 'Account'; Expression = {@("A_"+$_."Account") -replace "[^0-9a-zA-z]",'_'}}, * -ExcludeProperty Account# output to (new) csv file$Results | Export-Csv -Path "$Env:FILEPATH\Metadata\Bookingtest.csv" -NoTypeInformation
Is there a way to preserve column order upon export? Thank you!