I'm trying to use a PS script to try to automate part of a process where an export from one department's system can be imported into another departments system. I need to take rows with multiple ";" separated email address and split them into separate rows with 1 address each, while preserving the rest of the data. I have a solution for this that is mostly working, which relies on Import-CSV.
The problem I'm having is that The export I'm getting has multiple rows with the same column header. This causes Powershell to give me the error "The Member "end" is already present." (where "end" is the header on more than one column).
This happens just running "import-csv ./addresses.csv" when there are duplicate column headers, so I'm running afoul of the import-csv command itself I think, verses anything odd I may be doing with the script.
editing the csv to change one of the column names fixes this, but that requirement makes it difficult to automate the process.
Is there a way with powershell to work with a CSV with duplicate column names? I'd rather avoid specifying column names besides the one containing the e-mail addresses, because they seem to periodically change. It would be best if I could preserve the column names they are using.