- Notifications
You must be signed in to change notification settings - Fork8.1k
Open
Description
Prerequisites
- Write a descriptive title.
- Make sure you are able to repro it on thelatest released version
- Search the existing issues.
- Refer to theFAQ.
- Refer toDifferences between Windows PowerShell 5.1 and PowerShell.
Summary
This is a sub-issue of#25242.
ConvertTo-Csv andImport-Csv do not respect an explicit$false value for the-UseCulture switch parameter.
-UseCulture:$false doesn't behave as if the switch wasn't specified. It also doesn't behave as if itwas specified. Instead, it results in either no delimiter (ConvertTo-Csv) or a space as the delimiter (Import-Csv).
Steps to reproduce
ConvertTo-Csv:
[pscustomobject]@{H1='V1';H2='V2' }|ConvertTo-Csv-UseCulture:$false
Export-Csv:
$file= (New-TemporaryFile).FullName[pscustomobject]@{H1='V1';H2='V2' }|Export-Csv-LiteralPath$file-UseCulture:$false
Expected behavior
ConvertTo-Csv:
"H1","H2""V1","V2"Export-Csv:
"H1","H2""V1","V2"-UseCulture:$falsebehaves as if the switch wasn't specified.- The default
,item delimiter is used by both commands.
Actual behavior
ConvertTo-Csv:
"H1""H2""V1""V2"Export-Csv:
"H1" "H2""V1" "V2"-UseCulture:$falseneither behaves as if the switch was or wasn't specified.ConvertTo-Csvoutput includes no item delimiter.Export-Csvoutput includes a space as the item delimiter.
Environment data
Name Value---------PSVersion7.6.0-preview.5PSEdition CoreGitCommitId7.6.0-preview.5OS Microsoft Windows10.0.19045Platform Win32NTPSCompatibleVersions {1.0,2.0,3.0,4.0,5.0,5.1…}PSRemotingProtocolVersion2.3SerializationVersion1.1.0.1WSManStackVersion3.0