From f0ba537399e5e8988106170119235dd6a855f4ba Mon Sep 17 00:00:00 2001 From: surfingoldelephant <151538956+surfingoldelephant@users.noreply.github.com> Date: Sun, 28 Dec 2025 00:07:17 +0000 Subject: [PATCH 1/2] Update CSV cmdlet -Delimiter param description This clarifies the deserialization behavior when the specified delimiter doesn't match the actual delimiter in the input data. Before this change, the verbiage for Import/ConvertFrom-Csv implied one or more strings would be returned, which isn't the case. This also adds the existing note regarding escaped special characters to all docs. Previously, this was only present in Import-Csv docs, but is applicable to/useful for all CSV cmdlets. --- .../ConvertFrom-Csv.md | 20 ++++++---- .../ConvertTo-Csv.md | 8 +++- .../Export-Csv.md | 40 +++++++++++-------- .../Import-Csv.md | 15 ++++--- .../ConvertFrom-Csv.md | 20 ++++++---- .../ConvertTo-Csv.md | 8 +++- .../Export-Csv.md | 40 +++++++++++-------- .../Import-Csv.md | 15 ++++--- .../ConvertFrom-Csv.md | 20 ++++++---- .../ConvertTo-Csv.md | 8 +++- .../Export-Csv.md | 10 +++-- .../Import-Csv.md | 15 ++++--- .../ConvertFrom-Csv.md | 20 ++++++---- .../ConvertTo-Csv.md | 8 +++- .../Export-Csv.md | 21 ++++++---- .../Import-Csv.md | 15 ++++--- 16 files changed, 181 insertions(+), 102 deletions(-) diff --git a/reference/5.1/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md b/reference/5.1/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md index 20df4fd57db3..440cd3aaa960 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 11/18/2025 +ms.date: 12/27/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/convertfrom-csv?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: ConvertFrom-Csv @@ -10,6 +10,7 @@ title: ConvertFrom-Csv # ConvertFrom-Csv ## SYNOPSIS + Converts object properties in character-separated value (CSV) format into CSV versions of the original objects. @@ -145,7 +146,7 @@ the **InputObject** parameter and converts the CSV strings from the `$Services` When the **UseCulture** parameter is used, be sure that the current culture's default list separator matches the delimiter used in the CSV strings. Otherwise, `ConvertFrom-Csv` can't -generate objects from the CSV strings. +can't parse each column into distinct properties. ### Example 5: Convert CSV data in W3C Extended Log Format @@ -176,12 +177,17 @@ time cs-method cs-uri ### -Delimiter -Specifies the delimiter that separates the property values in the CSV strings. The default is a -comma (`,`). Enter a character, such as a colon (`:`). To specify a semicolon (`;`) enclose it in -single quotation marks. +Specifies the delimiter that separates the property values in the CSV data. The default is a comma +(`,`). + +Enter a character, such as a colon (`:`). To specify a semicolon (`;`), enclose it in single +quotation marks. To specify escaped special characters such as tab (`` `t ``), enclose it in double +quotation marks. -If you specify a character other than the actual string delimiter in the file, `ConvertFrom-Csv` -can't create the objects from the CSV strings and returns the CSV strings. +If the specified character doesn't match the actual delimiter in the CSV data, `ConvertFrom-Csv` +can't parse each column into distinct properties. In this case, it outputs one **PSCustomObject** +per row, each containing a single property whose name is the full header and whose value is the row +text. ```yaml Type: System.Char diff --git a/reference/5.1/Microsoft.PowerShell.Utility/ConvertTo-Csv.md b/reference/5.1/Microsoft.PowerShell.Utility/ConvertTo-Csv.md index 5b07a9678a99..943f69636dfa 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/ConvertTo-Csv.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/ConvertTo-Csv.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 03/14/2023 +ms.date: 12/27/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/convertto-csv?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: ConvertTo-Csv @@ -11,6 +11,7 @@ title: ConvertTo-Csv # ConvertTo-Csv ## SYNOPSIS + Converts .NET objects into a series of character-separated value (CSV) strings. ## SYNTAX @@ -109,7 +110,10 @@ information header from the CSV output. ### -Delimiter Specifies the delimiter to separate the property values in CSV strings. The default is a comma -(`,`). Enter a character, such as a colon (`:`). To specify a semicolon (`;`) enclose it in single +(`,`). + +Enter a character, such as a colon (`:`). To specify a semicolon (`;`), enclose it in single +quotation marks. To specify escaped special characters such as tab (`` `t ``), enclose it in double quotation marks. ```yaml diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Export-Csv.md b/reference/5.1/Microsoft.PowerShell.Utility/Export-Csv.md index 2b566898a32e..08ce0cde62b9 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Export-Csv.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Export-Csv.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 03/14/2023 +ms.date: 12/27/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/export-csv?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 aliases: @@ -13,6 +13,7 @@ title: Export-Csv # Export-Csv ## SYNOPSIS + Converts objects into a series of character-separated value (CSV) strings and saves the strings to a file. @@ -142,11 +143,12 @@ Get-Content -Path .\Processes.csv The `Get-Culture` cmdlet uses the nested properties **TextInfo** and **ListSeparator** and displays the current culture's default list separator. The `Get-Process` cmdlet gets **Process** objects. The process objects are sent down the pipeline to the `Export-Csv` cmdlet. `Export-Csv` converts the -process objects to a series of CSV strings. The **Path** parameter specifies that the `Processes.csv` -file is saved in the current directory. The **UseCulture** parameter uses the current culture's -default list separator as the delimiter. The **NoTypeInformation** parameter removes the **#TYPE** -information header from the CSV output and is not required in PowerShell 6. The `Get-Content` cmdlet -uses the **Path** parameter to display the file located in the current directory. +process objects to a series of CSV strings. The **Path** parameter specifies that the +`Processes.csv` file is saved in the current directory. The **UseCulture** parameter uses the +current culture's default list separator as the delimiter. The **NoTypeInformation** parameter +removes the **#TYPE** information header from the CSV output and is not required in PowerShell 6. +The `Get-Content` cmdlet uses the **Path** parameter to display the file located in the current +directory. ### Example 5: Export processes with type information @@ -176,10 +178,13 @@ This example describes how to export objects to a CSV file and use the **Append* objects to an existing file. ```powershell -$AppService = (Get-Service -DisplayName *Application* | Select-Object -Property DisplayName, Status) +$AppService = Get-Service -DisplayName *Application* | + Select-Object -Property DisplayName, Status $AppService | Export-Csv -Path .\Services.Csv -NoTypeInformation Get-Content -Path .\Services.Csv -$WinService = (Get-Service -DisplayName *Windows* | Select-Object -Property DisplayName, Status) + +$WinService = Get-Service -DisplayName *Windows* | + Select-Object -Property DisplayName, Status $WinService | Export-Csv -Path .\Services.csv -NoTypeInformation -Append Get-Content -Path .\Services.Csv ``` @@ -218,7 +223,7 @@ unexpected output is received, troubleshoot the pipeline syntax. ```powershell Get-Date | Select-Object -Property DateTime, Day, DayOfWeek, DayOfYear | - Export-Csv -Path .\DateTime.csv -NoTypeInformation + Export-Csv -Path .\DateTime.csv -NoTypeInformation Get-Content -Path .\DateTime.csv ``` @@ -229,7 +234,7 @@ Get-Content -Path .\DateTime.csv ```powershell Get-Date | Format-Table -Property DateTime, Day, DayOfWeek, DayOfYear | - Export-Csv -Path .\FTDateTime.csv -NoTypeInformation + Export-Csv -Path .\FTDateTime.csv -NoTypeInformation Get-Content -Path .\FTDateTime.csv ``` @@ -245,10 +250,10 @@ Get-Content -Path .\FTDateTime.csv The `Get-Date` cmdlet gets the **DateTime** object. The object is sent down the pipeline to the `Select-Object` cmdlet. `Select-Object` uses the **Property** parameter to select a subset of object properties. The object is sent down the pipeline to the `Export-Csv` cmdlet. `Export-Csv` converts -the object to a CSV format. The **Path** parameter specifies that the `DateTime.csv` file is saved in -the current directory. The **NoTypeInformation** parameter removes the **#TYPE** information header -from the CSV output and is not required in PowerShell 6. The `Get-Content` cmdlet uses the **Path** -parameter to display the CSV file located in the current directory. +the object to a CSV format. The **Path** parameter specifies that the `DateTime.csv` file is saved +in the current directory. The **NoTypeInformation** parameter removes the **#TYPE** information +header from the CSV output and is not required in PowerShell 6. The `Get-Content` cmdlet uses the +**Path** parameter to display the CSV file located in the current directory. When the `Format-Table` cmdlet is used within the pipeline to select properties unexpected results are received. `Format-Table` sends table format objects down the pipeline to the `Export-Csv` cmdlet @@ -372,8 +377,11 @@ Accept wildcard characters: False ### -Delimiter -Specifies a delimiter to separate the property values. The default is a comma (`,`). Enter a -character, such as a colon (`:`). To specify a semicolon (`;`), enclose it in quotation marks. +Specifies a delimiter to separate the property values. The default is a comma (`,`). + +Enter a character, such as a colon (`:`). To specify a semicolon (`;`), enclose it in single +quotation marks. To specify escaped special characters such as tab (`` `t ``), enclose it in double +quotation marks. ```yaml Type: System.Char diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Import-Csv.md b/reference/5.1/Microsoft.PowerShell.Utility/Import-Csv.md index 0866ffe354fe..55dfdfaf5ac7 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Import-Csv.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Import-Csv.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 01/09/2025 +ms.date: 12/27/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/import-csv?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 aliases: @@ -13,6 +13,7 @@ title: Import-Csv # Import-Csv ## SYNOPSIS + Creates table-like custom objects from the items in a character-separated value (CSV) file. ## SYNTAX @@ -271,8 +272,8 @@ Import-Csv -Path .\Projects.csv ``` ```Output -WARNING: One or more headers weren't specified. Default names starting with "H" have been used in -place of any missing headers. +WARNING: One or more headers weren't specified. Default names starting with "H" have been +used in place of any missing headers. ProjectID ProjectName H1 Completed --------- ----------- -- --------- @@ -292,12 +293,14 @@ displays a warning message because **H1** is a default header name. Specifies the delimiter that separates the property values in the CSV file. The default is a comma (`,`). -Enter a character, such as a colon (`:`). To specify a semicolon (`;`) enclose it in single +Enter a character, such as a colon (`:`). To specify a semicolon (`;`), enclose it in single quotation marks. To specify escaped special characters such as tab (`` `t ``), enclose it in double quotation marks. -If you specify a character other than the actual string delimiter in the file, `Import-Csv` can't -create the objects from the CSV strings and returns the full CSV strings. +If the specified character doesn't match the actual delimiter in the CSV data, `Import-Csv` can't +parse each column into distinct properties. In this case, it outputs one **PSCustomObject** per +row, each containing a single property whose name is the full header and whose value is the row +text. ```yaml Type: System.Char diff --git a/reference/7.4/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md b/reference/7.4/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md index 6980ee05592c..7032af9335ce 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 11/18/2025 +ms.date: 12/27/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/convertfrom-csv?view=powershell-7.4&WT.mc_id=ps-gethelp schema: 2.0.0 title: ConvertFrom-Csv @@ -10,6 +10,7 @@ title: ConvertFrom-Csv # ConvertFrom-Csv ## SYNOPSIS + Converts object properties in character-separated value (CSV) format into CSV versions of the original objects. @@ -145,7 +146,7 @@ the **InputObject** parameter and converts the CSV strings from the `$Services` When the **UseCulture** parameter is used, be sure that the current culture's default list separator matches the delimiter used in the CSV strings. Otherwise, `ConvertFrom-Csv` can't -generate objects from the CSV strings. +can't parse each column into distinct properties. ### Example 5: Convert CSV data in W3C Extended Log Format @@ -177,12 +178,17 @@ time cs-method cs-uri ### -Delimiter -Specifies the delimiter that separates the property values in the CSV strings. The default is a -comma (`,`). Enter a character, such as a colon (`:`). To specify a semicolon (`;`) enclose it in -single quotation marks. +Specifies the delimiter that separates the property values in the CSV data. The default is a comma +(`,`). + +Enter a character, such as a colon (`:`). To specify a semicolon (`;`), enclose it in single +quotation marks. To specify escaped special characters such as tab (`` `t ``), enclose it in double +quotation marks. -If you specify a character other than the actual string delimiter in the file, `ConvertFrom-Csv` -can't create the objects from the CSV strings and returns the CSV strings. +If the specified character doesn't match the actual delimiter in the CSV data, `ConvertFrom-Csv` +can't parse each column into distinct properties. In this case, it outputs one **PSCustomObject** +per row, each containing a single property whose name is the full header and whose value is the row +text. ```yaml Type: System.Char diff --git a/reference/7.4/Microsoft.PowerShell.Utility/ConvertTo-Csv.md b/reference/7.4/Microsoft.PowerShell.Utility/ConvertTo-Csv.md index 24b44cf2fe54..08c91d2de45a 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/ConvertTo-Csv.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/ConvertTo-Csv.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 03/14/2023 +ms.date: 12/27/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/convertto-csv?view=powershell-7.4&WT.mc_id=ps-gethelp schema: 2.0.0 title: ConvertTo-Csv @@ -11,6 +11,7 @@ title: ConvertTo-Csv # ConvertTo-Csv ## SYNOPSIS + Converts .NET objects into a series of character-separated value (CSV) strings. ## SYNTAX @@ -186,7 +187,10 @@ only the key is converted to CSV. ### -Delimiter Specifies the delimiter to separate the property values in CSV strings. The default is a comma -(`,`). Enter a character, such as a colon (`:`). To specify a semicolon (`;`) enclose it in single +(`,`). + +Enter a character, such as a colon (`:`). To specify a semicolon (`;`), enclose it in single +quotation marks. To specify escaped special characters such as tab (`` `t ``), enclose it in double quotation marks. ```yaml diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Export-Csv.md b/reference/7.4/Microsoft.PowerShell.Utility/Export-Csv.md index b62fbaea6ced..dde53f1a9eb3 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Export-Csv.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Export-Csv.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 03/15/2023 +ms.date: 12/27/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/export-csv?view=powershell-7.4&WT.mc_id=ps-gethelp schema: 2.0.0 aliases: @@ -13,6 +13,7 @@ title: Export-Csv # Export-Csv ## SYNOPSIS + Converts objects into a series of character-separated value (CSV) strings and saves the strings to a file. @@ -144,11 +145,12 @@ Get-Content -Path .\Processes.csv The `Get-Culture` cmdlet uses the nested properties **TextInfo** and **ListSeparator** and displays the current culture's default list separator. The `Get-Process` cmdlet gets **Process** objects. The process objects are sent down the pipeline to the `Export-Csv` cmdlet. `Export-Csv` converts the -process objects to a series of CSV strings. The **Path** parameter specifies that the `Processes.csv` -file is saved in the current directory. The **UseCulture** parameter uses the current culture's -default list separator as the delimiter. The **NoTypeInformation** parameter removes the **#TYPE** -information header from the CSV output and is not required in PowerShell 6. The `Get-Content` cmdlet -uses the **Path** parameter to display the file located in the current directory. +process objects to a series of CSV strings. The **Path** parameter specifies that the +`Processes.csv` file is saved in the current directory. The **UseCulture** parameter uses the +current culture's default list separator as the delimiter. The **NoTypeInformation** parameter +removes the **#TYPE** information header from the CSV output and is not required in PowerShell 6. +The `Get-Content` cmdlet uses the **Path** parameter to display the file located in the current +directory. ### Example 5: Export processes with type information @@ -179,10 +181,13 @@ This example describes how to export objects to a CSV file and use the **Append* objects to an existing file. ```powershell -$AppService = (Get-Service -DisplayName *Application* | Select-Object -Property DisplayName, Status) +$AppService = Get-Service -DisplayName *Application* | + Select-Object -Property DisplayName, Status $AppService | Export-Csv -Path .\Services.Csv -NoTypeInformation Get-Content -Path .\Services.Csv -$WinService = (Get-Service -DisplayName *Windows* | Select-Object -Property DisplayName, Status) + +$WinService = Get-Service -DisplayName *Windows* | + Select-Object -Property DisplayName, Status $WinService | Export-Csv -Path .\Services.csv -NoTypeInformation -Append Get-Content -Path .\Services.Csv ``` @@ -221,7 +226,7 @@ unexpected output is received, troubleshoot the pipeline syntax. ```powershell Get-Date | Select-Object -Property DateTime, Day, DayOfWeek, DayOfYear | - Export-Csv -Path .\DateTime.csv -NoTypeInformation + Export-Csv -Path .\DateTime.csv -NoTypeInformation Get-Content -Path .\DateTime.csv ``` @@ -232,7 +237,7 @@ Get-Content -Path .\DateTime.csv ```powershell Get-Date | Format-Table -Property DateTime, Day, DayOfWeek, DayOfYear | - Export-Csv -Path .\FTDateTime.csv -NoTypeInformation + Export-Csv -Path .\FTDateTime.csv -NoTypeInformation Get-Content -Path .\FTDateTime.csv ``` @@ -248,10 +253,10 @@ Get-Content -Path .\FTDateTime.csv The `Get-Date` cmdlet gets the **DateTime** object. The object is sent down the pipeline to the `Select-Object` cmdlet. `Select-Object` uses the **Property** parameter to select a subset of object properties. The object is sent down the pipeline to the `Export-Csv` cmdlet. `Export-Csv` converts -the object to a CSV format. The **Path** parameter specifies that the `DateTime.csv` file is saved in -the current directory. The **NoTypeInformation** parameter removes the **#TYPE** information header -from the CSV output and is not required in PowerShell 6. The `Get-Content` cmdlet uses the **Path** -parameter to display the CSV file located in the current directory. +the object to a CSV format. The **Path** parameter specifies that the `DateTime.csv` file is saved +in the current directory. The **NoTypeInformation** parameter removes the **#TYPE** information +header from the CSV output and is not required in PowerShell 6. The `Get-Content` cmdlet uses the +**Path** parameter to display the CSV file located in the current directory. When the `Format-Table` cmdlet is used within the pipeline to select properties unexpected results are received. `Format-Table` sends table format objects down the pipeline to the `Export-Csv` cmdlet @@ -456,8 +461,11 @@ Accept wildcard characters: False ### -Delimiter -Specifies a delimiter to separate the property values. The default is a comma (`,`). Enter a -character, such as a colon (`:`). To specify a semicolon (`;`), enclose it in quotation marks. +Specifies a delimiter to separate the property values. The default is a comma (`,`). + +Enter a character, such as a colon (`:`). To specify a semicolon (`;`), enclose it in single +quotation marks. To specify escaped special characters such as tab (`` `t ``), enclose it in double +quotation marks. ```yaml Type: System.Char diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Import-Csv.md b/reference/7.4/Microsoft.PowerShell.Utility/Import-Csv.md index a65d9de00161..451f034bf86d 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Import-Csv.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Import-Csv.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 01/09/2025 +ms.date: 12/27/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/import-csv?view=powershell-7.4&WT.mc_id=ps-gethelp schema: 2.0.0 aliases: @@ -13,6 +13,7 @@ title: Import-Csv # Import-Csv ## SYNOPSIS + Creates table-like custom objects from the items in a character-separated value (CSV) file. ## SYNTAX @@ -284,8 +285,8 @@ Import-Csv -Path .\Projects.csv ``` ```Output -WARNING: One or more headers weren't specified. Default names starting with "H" have been used in -place of any missing headers. +WARNING: One or more headers weren't specified. Default names starting with "H" have been +used in place of any missing headers. ProjectID ProjectName H1 Completed --------- ----------- -- --------- @@ -305,12 +306,14 @@ displays a warning message because **H1** is a default header name. Specifies the delimiter that separates the property values in the CSV file. The default is a comma (`,`). -Enter a character, such as a colon (`:`). To specify a semicolon (`;`) enclose it in single +Enter a character, such as a colon (`:`). To specify a semicolon (`;`), enclose it in single quotation marks. To specify escaped special characters such as tab (`` `t ``), enclose it in double quotation marks. -If you specify a character other than the actual string delimiter in the file, `Import-Csv` can't -create the objects from the CSV strings and returns the full CSV strings. +If the specified character doesn't match the actual delimiter in the CSV data, `Import-Csv` can't +parse each column into distinct properties. In this case, it outputs one **PSCustomObject** per +row, each containing a single property whose name is the full header and whose value is the row +text. ```yaml Type: System.Char diff --git a/reference/7.5/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md b/reference/7.5/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md index ad1d86c5b7d1..82bab5b3cbb0 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 11/18/2025 +ms.date: 12/27/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/convertfrom-csv?view=powershell-7.5&WT.mc_id=ps-gethelp schema: 2.0.0 title: ConvertFrom-Csv @@ -10,6 +10,7 @@ title: ConvertFrom-Csv # ConvertFrom-Csv ## SYNOPSIS + Converts object properties in character-separated value (CSV) format into CSV versions of the original objects. @@ -145,7 +146,7 @@ the **InputObject** parameter and converts the CSV strings from the `$Services` When the **UseCulture** parameter is used, be sure that the current culture's default list separator matches the delimiter used in the CSV strings. Otherwise, `ConvertFrom-Csv` can't -generate objects from the CSV strings. +can't parse each column into distinct properties. ### Example 5: Convert CSV data in W3C Extended Log Format @@ -177,12 +178,17 @@ time cs-method cs-uri ### -Delimiter -Specifies the delimiter that separates the property values in the CSV strings. The default is a -comma (`,`). Enter a character, such as a colon (`:`). To specify a semicolon (`;`) enclose it in -single quotation marks. +Specifies the delimiter that separates the property values in the CSV data. The default is a comma +(`,`). + +Enter a character, such as a colon (`:`). To specify a semicolon (`;`), enclose it in single +quotation marks. To specify escaped special characters such as tab (`` `t ``), enclose it in double +quotation marks. -If you specify a character other than the actual string delimiter in the file, `ConvertFrom-Csv` -can't create the objects from the CSV strings and returns the CSV strings. +If the specified character doesn't match the actual delimiter in the CSV data, `ConvertFrom-Csv` +can't parse each column into distinct properties. In this case, it outputs one **PSCustomObject** +per row, each containing a single property whose name is the full header and whose value is the row +text. ```yaml Type: System.Char diff --git a/reference/7.5/Microsoft.PowerShell.Utility/ConvertTo-Csv.md b/reference/7.5/Microsoft.PowerShell.Utility/ConvertTo-Csv.md index 461b9497ef61..6680c935b611 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/ConvertTo-Csv.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/ConvertTo-Csv.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 03/14/2023 +ms.date: 12/27/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/convertto-csv?view=powershell-7.5&WT.mc_id=ps-gethelp schema: 2.0.0 title: ConvertTo-Csv @@ -11,6 +11,7 @@ title: ConvertTo-Csv # ConvertTo-Csv ## SYNOPSIS + Converts .NET objects into a series of character-separated value (CSV) strings. ## SYNTAX @@ -188,7 +189,10 @@ only the key is converted to CSV. ### -Delimiter Specifies the delimiter to separate the property values in CSV strings. The default is a comma -(`,`). Enter a character, such as a colon (`:`). To specify a semicolon (`;`) enclose it in single +(`,`). + +Enter a character, such as a colon (`:`). To specify a semicolon (`;`), enclose it in single +quotation marks. To specify escaped special characters such as tab (`` `t ``), enclose it in double quotation marks. ```yaml diff --git a/reference/7.5/Microsoft.PowerShell.Utility/Export-Csv.md b/reference/7.5/Microsoft.PowerShell.Utility/Export-Csv.md index 0e5f58fddaba..9482644e2f3f 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/Export-Csv.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/Export-Csv.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 03/15/2023 +ms.date: 12/27/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/export-csv?view=powershell-7.5&WT.mc_id=ps-gethelp schema: 2.0.0 aliases: @@ -13,6 +13,7 @@ title: Export-Csv # Export-Csv ## SYNOPSIS + Converts objects into a series of character-separated value (CSV) strings and saves the strings to a file. @@ -460,8 +461,11 @@ Accept wildcard characters: False ### -Delimiter -Specifies a delimiter to separate the property values. The default is a comma (`,`). Enter a -character, such as a colon (`:`). To specify a semicolon (`;`), enclose it in quotation marks. +Specifies a delimiter to separate the property values. The default is a comma (`,`). + +Enter a character, such as a colon (`:`). To specify a semicolon (`;`), enclose it in single +quotation marks. To specify escaped special characters such as tab (`` `t ``), enclose it in double +quotation marks. ```yaml Type: System.Char diff --git a/reference/7.5/Microsoft.PowerShell.Utility/Import-Csv.md b/reference/7.5/Microsoft.PowerShell.Utility/Import-Csv.md index 3af35608f0f0..5d2e0f19caee 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/Import-Csv.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/Import-Csv.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 01/09/2025 +ms.date: 12/27/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/import-csv?view=powershell-7.5&WT.mc_id=ps-gethelp schema: 2.0.0 aliases: @@ -13,6 +13,7 @@ title: Import-Csv # Import-Csv ## SYNOPSIS + Creates table-like custom objects from the items in a character-separated value (CSV) file. ## SYNTAX @@ -284,8 +285,8 @@ Import-Csv -Path .\Projects.csv ``` ```Output -WARNING: One or more headers weren't specified. Default names starting with "H" have been used in -place of any missing headers. +WARNING: One or more headers weren't specified. Default names starting with "H" have been +used in place of any missing headers. ProjectID ProjectName H1 Completed --------- ----------- -- --------- @@ -305,12 +306,14 @@ displays a warning message because **H1** is a default header name. Specifies the delimiter that separates the property values in the CSV file. The default is a comma (`,`). -Enter a character, such as a colon (`:`). To specify a semicolon (`;`) enclose it in single +Enter a character, such as a colon (`:`). To specify a semicolon (`;`), enclose it in single quotation marks. To specify escaped special characters such as tab (`` `t ``), enclose it in double quotation marks. -If you specify a character other than the actual string delimiter in the file, `Import-Csv` can't -create the objects from the CSV strings and returns the full CSV strings. +If the specified character doesn't match the actual delimiter in the CSV data, `Import-Csv` can't +parse each column into distinct properties. In this case, it outputs one **PSCustomObject** per +row, each containing a single property whose name is the full header and whose value is the row +text. ```yaml Type: System.Char diff --git a/reference/7.6/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md b/reference/7.6/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md index b8e0ee377713..fcb9eee839bd 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 11/18/2025 +ms.date: 12/27/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/convertfrom-csv?view=powershell-7.6&WT.mc_id=ps-gethelp schema: 2.0.0 title: ConvertFrom-Csv @@ -10,6 +10,7 @@ title: ConvertFrom-Csv # ConvertFrom-Csv ## SYNOPSIS + Converts object properties in character-separated value (CSV) format into CSV versions of the original objects. @@ -145,7 +146,7 @@ the **InputObject** parameter and converts the CSV strings from the `$Services` When the **UseCulture** parameter is used, be sure that the current culture's default list separator matches the delimiter used in the CSV strings. Otherwise, `ConvertFrom-Csv` can't -generate objects from the CSV strings. +can't parse each column into distinct properties. ### Example 5: Convert CSV data in W3C Extended Log Format @@ -177,12 +178,17 @@ time cs-method cs-uri ### -Delimiter -Specifies the delimiter that separates the property values in the CSV strings. The default is a -comma (`,`). Enter a character, such as a colon (`:`). To specify a semicolon (`;`) enclose it in -single quotation marks. +Specifies the delimiter that separates the property values in the CSV data. The default is a comma +(`,`). + +Enter a character, such as a colon (`:`). To specify a semicolon (`;`), enclose it in single +quotation marks. To specify escaped special characters such as tab (`` `t ``), enclose it in double +quotation marks. -If you specify a character other than the actual string delimiter in the file, `ConvertFrom-Csv` -can't create the objects from the CSV strings and returns the CSV strings. +If the specified character doesn't match the actual delimiter in the CSV data, `ConvertFrom-Csv` +can't parse each column into distinct properties. In this case, it outputs one **PSCustomObject** +per row, each containing a single property whose name is the full header and whose value is the row +text. ```yaml Type: System.Char diff --git a/reference/7.6/Microsoft.PowerShell.Utility/ConvertTo-Csv.md b/reference/7.6/Microsoft.PowerShell.Utility/ConvertTo-Csv.md index 268917fbef92..4521d66a274c 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/ConvertTo-Csv.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/ConvertTo-Csv.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 03/14/2023 +ms.date: 12/27/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/convertto-csv?view=powershell-7.6&WT.mc_id=ps-gethelp schema: 2.0.0 title: ConvertTo-Csv @@ -11,6 +11,7 @@ title: ConvertTo-Csv # ConvertTo-Csv ## SYNOPSIS + Converts .NET objects into a series of character-separated value (CSV) strings. ## SYNTAX @@ -186,7 +187,10 @@ only the key is converted to CSV. ### -Delimiter Specifies the delimiter to separate the property values in CSV strings. The default is a comma -(`,`). Enter a character, such as a colon (`:`). To specify a semicolon (`;`) enclose it in single +(`,`). + +Enter a character, such as a colon (`:`). To specify a semicolon (`;`), enclose it in single +quotation marks. To specify escaped special characters such as tab (`` `t ``), enclose it in double quotation marks. ```yaml diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Export-Csv.md b/reference/7.6/Microsoft.PowerShell.Utility/Export-Csv.md index e0efa06265ac..7dab69ba4146 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Export-Csv.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Export-Csv.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 03/15/2023 +ms.date: 12/27/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/export-csv?view=powershell-7.6&WT.mc_id=ps-gethelp schema: 2.0.0 aliases: @@ -13,6 +13,7 @@ title: Export-Csv # Export-Csv ## SYNOPSIS + Converts objects into a series of character-separated value (CSV) strings and saves the strings to a file. @@ -179,10 +180,13 @@ This example describes how to export objects to a CSV file and use the **Append* objects to an existing file. ```powershell -$AppService = (Get-Service -DisplayName *Application* | Select-Object -Property DisplayName, Status) +$AppService = Get-Service -DisplayName *Application* | + Select-Object -Property DisplayName, Status $AppService | Export-Csv -Path .\Services.Csv -NoTypeInformation Get-Content -Path .\Services.Csv -$WinService = (Get-Service -DisplayName *Windows* | Select-Object -Property DisplayName, Status) + +$WinService = Get-Service -DisplayName *Windows* | + Select-Object -Property DisplayName, Status $WinService | Export-Csv -Path .\Services.csv -NoTypeInformation -Append Get-Content -Path .\Services.Csv ``` @@ -221,7 +225,7 @@ unexpected output is received, troubleshoot the pipeline syntax. ```powershell Get-Date | Select-Object -Property DateTime, Day, DayOfWeek, DayOfYear | - Export-Csv -Path .\DateTime.csv -NoTypeInformation + Export-Csv -Path .\DateTime.csv -NoTypeInformation Get-Content -Path .\DateTime.csv ``` @@ -232,7 +236,7 @@ Get-Content -Path .\DateTime.csv ```powershell Get-Date | Format-Table -Property DateTime, Day, DayOfWeek, DayOfYear | - Export-Csv -Path .\FTDateTime.csv -NoTypeInformation + Export-Csv -Path .\FTDateTime.csv -NoTypeInformation Get-Content -Path .\FTDateTime.csv ``` @@ -456,8 +460,11 @@ Accept wildcard characters: False ### -Delimiter -Specifies a delimiter to separate the property values. The default is a comma (`,`). Enter a -character, such as a colon (`:`). To specify a semicolon (`;`), enclose it in quotation marks. +Specifies a delimiter to separate the property values. The default is a comma (`,`). + +Enter a character, such as a colon (`:`). To specify a semicolon (`;`), enclose it in single +quotation marks. To specify escaped special characters such as tab (`` `t ``), enclose it in double +quotation marks. ```yaml Type: System.Char diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Import-Csv.md b/reference/7.6/Microsoft.PowerShell.Utility/Import-Csv.md index 2fa2ddfa0444..794c152f7b4c 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Import-Csv.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Import-Csv.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 01/09/2025 +ms.date: 12/27/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/import-csv?view=powershell-7.6&WT.mc_id=ps-gethelp schema: 2.0.0 aliases: @@ -13,6 +13,7 @@ title: Import-Csv # Import-Csv ## SYNOPSIS + Creates table-like custom objects from the items in a character-separated value (CSV) file. ## SYNTAX @@ -284,8 +285,8 @@ Import-Csv -Path .\Projects.csv ``` ```Output -WARNING: One or more headers weren't specified. Default names starting with "H" have been used in -place of any missing headers. +WARNING: One or more headers weren't specified. Default names starting with "H" have been +used in place of any missing headers. ProjectID ProjectName H1 Completed --------- ----------- -- --------- @@ -305,12 +306,14 @@ displays a warning message because **H1** is a default header name. Specifies the delimiter that separates the property values in the CSV file. The default is a comma (`,`). -Enter a character, such as a colon (`:`). To specify a semicolon (`;`) enclose it in single +Enter a character, such as a colon (`:`). To specify a semicolon (`;`), enclose it in single quotation marks. To specify escaped special characters such as tab (`` `t ``), enclose it in double quotation marks. -If you specify a character other than the actual string delimiter in the file, `Import-Csv` can't -create the objects from the CSV strings and returns the full CSV strings. +If the specified character doesn't match the actual delimiter in the CSV data, `Import-Csv` can't +parse each column into distinct properties. In this case, it outputs one **PSCustomObject** per +row, each containing a single property whose name is the full header and whose value is the row +text. ```yaml Type: System.Char From afa22b4a10d7cf51140b9e782a14941fd951e37e Mon Sep 17 00:00:00 2001 From: "Mikey Lombardi (He/Him)" Date: Fri, 2 Jan 2026 14:56:55 -0600 Subject: [PATCH 2/2] Apply suggestions from review --- reference/5.1/Microsoft.PowerShell.Utility/Export-Csv.md | 4 ++++ reference/7.4/Microsoft.PowerShell.Utility/Export-Csv.md | 4 ++++ reference/7.6/Microsoft.PowerShell.Utility/Export-Csv.md | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Export-Csv.md b/reference/5.1/Microsoft.PowerShell.Utility/Export-Csv.md index 08ce0cde62b9..29cdca820654 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Export-Csv.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Export-Csv.md @@ -180,11 +180,13 @@ objects to an existing file. ```powershell $AppService = Get-Service -DisplayName *Application* | Select-Object -Property DisplayName, Status + $AppService | Export-Csv -Path .\Services.Csv -NoTypeInformation Get-Content -Path .\Services.Csv $WinService = Get-Service -DisplayName *Windows* | Select-Object -Property DisplayName, Status + $WinService | Export-Csv -Path .\Services.csv -NoTypeInformation -Append Get-Content -Path .\Services.Csv ``` @@ -224,6 +226,7 @@ unexpected output is received, troubleshoot the pipeline syntax. ```powershell Get-Date | Select-Object -Property DateTime, Day, DayOfWeek, DayOfYear | Export-Csv -Path .\DateTime.csv -NoTypeInformation + Get-Content -Path .\DateTime.csv ``` @@ -235,6 +238,7 @@ Get-Content -Path .\DateTime.csv ```powershell Get-Date | Format-Table -Property DateTime, Day, DayOfWeek, DayOfYear | Export-Csv -Path .\FTDateTime.csv -NoTypeInformation + Get-Content -Path .\FTDateTime.csv ``` diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Export-Csv.md b/reference/7.4/Microsoft.PowerShell.Utility/Export-Csv.md index dde53f1a9eb3..d102d002f31c 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Export-Csv.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Export-Csv.md @@ -183,11 +183,13 @@ objects to an existing file. ```powershell $AppService = Get-Service -DisplayName *Application* | Select-Object -Property DisplayName, Status + $AppService | Export-Csv -Path .\Services.Csv -NoTypeInformation Get-Content -Path .\Services.Csv $WinService = Get-Service -DisplayName *Windows* | Select-Object -Property DisplayName, Status + $WinService | Export-Csv -Path .\Services.csv -NoTypeInformation -Append Get-Content -Path .\Services.Csv ``` @@ -227,6 +229,7 @@ unexpected output is received, troubleshoot the pipeline syntax. ```powershell Get-Date | Select-Object -Property DateTime, Day, DayOfWeek, DayOfYear | Export-Csv -Path .\DateTime.csv -NoTypeInformation + Get-Content -Path .\DateTime.csv ``` @@ -238,6 +241,7 @@ Get-Content -Path .\DateTime.csv ```powershell Get-Date | Format-Table -Property DateTime, Day, DayOfWeek, DayOfYear | Export-Csv -Path .\FTDateTime.csv -NoTypeInformation + Get-Content -Path .\FTDateTime.csv ``` diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Export-Csv.md b/reference/7.6/Microsoft.PowerShell.Utility/Export-Csv.md index 7dab69ba4146..f6aed2d3ddf1 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Export-Csv.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Export-Csv.md @@ -182,11 +182,13 @@ objects to an existing file. ```powershell $AppService = Get-Service -DisplayName *Application* | Select-Object -Property DisplayName, Status + $AppService | Export-Csv -Path .\Services.Csv -NoTypeInformation Get-Content -Path .\Services.Csv $WinService = Get-Service -DisplayName *Windows* | Select-Object -Property DisplayName, Status + $WinService | Export-Csv -Path .\Services.csv -NoTypeInformation -Append Get-Content -Path .\Services.Csv ``` @@ -226,6 +228,7 @@ unexpected output is received, troubleshoot the pipeline syntax. ```powershell Get-Date | Select-Object -Property DateTime, Day, DayOfWeek, DayOfYear | Export-Csv -Path .\DateTime.csv -NoTypeInformation + Get-Content -Path .\DateTime.csv ``` @@ -237,6 +240,7 @@ Get-Content -Path .\DateTime.csv ```powershell Get-Date | Format-Table -Property DateTime, Day, DayOfWeek, DayOfYear | Export-Csv -Path .\FTDateTime.csv -NoTypeInformation + Get-Content -Path .\FTDateTime.csv ```