As of this writing, the question contains an additional, incidental mistake: {$_.Name} is used to specify the output filename: however, {$_.Name} is a script block that in a string context evaluates to its literal contents, i.e., literal $_.Name. By contrast, the intent is to specify the Name property of the current pipeline object ($_) as the filename: $_.Name by itself will do - no quoting or other qualification is needed (although "$($_.Name)" too would work, inside a double-quoted string).
To complement Elton Ji - MSFT's helpful answer:
Note: The following applies analogously to Import-Csv's in-memory counterpart, ConvertFrom-Csv.
The error message you're getting (member "<name>" is already present) tells you that duplicate values exist in the input CSV file's 1st line (as woxxom also notes in a comment on the question).
Import-Csv expects an input file to start with a header row, i.e it expects the first line (row) to contain column names, with the subsequent rows containing the data.
- These column names become the properties (members) of the objects (
[pscustomobject] instances) that PowerShell constructs from the data rows, and given that an object (class) cannot have multiple properties with the same name, duplicate column names aren't allowed.
It sounds like your input file is missing such a header row, which caused the first data row to be interpreted as the header row, and because it happened to contain duplicate values, the command broke.
If a header row is missing, you can make up for that with the -Header parameter, which allows you to specify column names ad-hoc, with Import-Csv -Header <colName1>, <colName2>, ....
If you specify fewer column names than data columns, the extra columns are ignored.
If you specify more column names than data columns, additional properties are created, but they'll have value $null.
As of PowerShell 7.3.3, there is no way to let PowerShell create headers for you automatically. See the feature request in GitHub issue #19334.
{$_.Name}is a script block. Remove{and}or use(Join-Path 'c:\somewhere' $_.Name)Import-csv