Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1803,6 +1803,10 @@ internal static char SetDelimiter(PSCmdlet cmdlet, string parameterSetName, char
// [CultureInfo]::GetCultures("AllCultures") | % { ([CultureInfo]($_.Name)).TextInfo.ListSeparator } | ? Length -ne 1
delimiter = CultureInfo.CurrentCulture.TextInfo.ListSeparator[0];
}
else
{
delimiter = ImportExportCSVHelper.CSVDelimiter;
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use conditional operator.

delimiter = useCulture ? ... : ...

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@blanca-negrete Please address my request.

Comment on lines +1806 to +1809
Copy link

Copilot AI Dec 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fix for handling UseCulture:$false correctly lacks test coverage. While the fix itself is correct, automated tests should be added to verify that:

  1. When -UseCulture:$false is explicitly specified, the default comma delimiter is used (not the culture-specific delimiter)
  2. When -UseCulture is omitted, the default comma delimiter is used
  3. When -UseCulture or -UseCulture:$true is specified, the culture-specific delimiter is used

These tests would prevent regression of issue #26513 and can be added to the existing test files (e.g., ConvertTo-Csv.Tests.ps1 or ImportExportCSV.Delimiter.Tests.ps1).

Copilot uses AI. Check for mistakes.

break;
default:
Expand Down