Skip to content

Commit bd5da2a

Browse files
author
Thatgfsj
committed
Fix ConvertTo-Csv/Export-Csv -UseCulture:$false uses wrong delimiter (Fixes PowerShell#26513)
1 parent 1e5c020 commit bd5da2a

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

  • src/Microsoft.PowerShell.Commands.Utility/commands/utility

‎src/Microsoft.PowerShell.Commands.Utility/commands/utility/CsvCommands.cs‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1793,6 +1793,11 @@ internal static char SetDelimiter(PSCmdlet cmdlet, string parameterSetName, char
17931793
// [CultureInfo]::GetCultures("AllCultures") | % { ([CultureInfo]($_.Name)).TextInfo.ListSeparator } | ? Length -ne 1
17941794
delimiter = CultureInfo.CurrentCulture.TextInfo.ListSeparator[0];
17951795
}
1796+
else
1797+
{
1798+
// When -UseCulture:$false is used, default to comma delimiter
1799+
delimiter = ImportExportCSVHelper.CSVDelimiter;
1800+
}
17961801

17971802
break;
17981803
default:

0 commit comments

Comments
 (0)